How to import modules with PyCharm and MicroPython?

I decided to test PyCharm with Raspberry Pi Pico. I created a simple test program with MicroPython. Everything seems to work when all the code is in the main file called ''. After that, I decided to create another module called ''. However, it seems that the module is not imported even if it is in the same directory than the main file:

Traceback (most recent call last):
  File "", line 7, in <module>
ImportError: no module named 'my_sensor'
MicroPython v1.18 on 2022-01-17; Raspberry Pi Pico with RP2040
Type "help()" for more information.

It seems that the module is not included when the application is uploaded to Raspberry Pi Pico. I do not understand why. I cannot see any errors or warnings in the IDE.


Hi, are you able to upload and run your code from the terminal without using the IDE? If so, feel free to submit an issue to


Hi, i had the same Problem. It seems to be the case that you have to flash each file seperately onto the Pico. In your case, right click on your file in the Project Window and chose Run 'Flash' just as you did with your file


Please sign in to leave a comment.