Skip to content

ImportError: no module named 'KPU' when running .py script #501

@FreySpec

Description

@FreySpec

Hello,

I'm encountering an issue while trying to run my .py script in my IDE. The error message I receive is as follows:

ImportError: no module named 'KPU'

I've already searched through the official documentation and various forums for a solution but haven't found any relevant help addressing this specific problem.

Could anyone provide guidance on how to resolve this ImportError? Is there something specific I need to install or configure to get the 'KPU' module recognized by my script?

Context
I have two scripts. The first script runs without any issues, indicating that the hardware is functioning correctly:

`import sensor
import image
import lcd
import time

lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
green_threshold = (0, 80, -70, -10, -0, 30)

while True:
img = sensor.snapshot()
blobs = img.find_blobs([green_threshold])
if blobs:
for b in blobs:
tmp = img.draw_rectangle(b[0:4])
tmp = img.draw_cross(b[5], b[6])
c = img.get_pixel(b[5], b[6])
lcd.display(img)`

However, when I try to run a similar script that includes the KPU module, I encounter the ImportError. Here is the problematic script:

Image

Thank you very much in advance for your assistance.

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions