skip to Main Content

I have the Sensor.py file in the same folder as my Main.py
I get this message: ImportError: no module named ‘Sensor’

How can I import .py files?

I’ve tried all import options.

2

Answers


  1. Chosen as BEST ANSWER

    I need to save the sensor.py first, then upload it to the pico, and then I can play the main.py. The sensor.py was missing on the pico. Simply clicking main.py on run is not enough.


  2. Run in your terminal

    pip install sensor 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search