-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MicroPython cannot find the module. #140
Comments
There is another issue where, when running a MicroPython project and disconnecting the circuit board suddenly, the "Run" button in the status bar of Visual Studio Code will become stuck and will not stop, even after trying to reconnect the circuit board and stopping. The only solution is to restart Visual Studio Code or the extension. |
I don't know if this is the same bug, but if I start a new MicroPython project, and let it suggest the Blink project, it cannot find the module machine. I can copy the Blink project into Thonny and it runs beautifully. |
Thank you for reaching out! The issue you're experiencing occurs because the modules are located on your host machine and not on the Pico itself. When you execute a script on the Pico, its Python interpreter cannot resolve or access those modules unless they are uploaded to the device. To resolve this, I recommend uploading either the entire project or just the specific modules you need to the Pico before running your script. Keep in mind that if you update any of the modules locally, you will need to upload the changes again to test them on the Pico. |
How do you execute the blink script? (Keep in mind that the default run button does not work if you want to execute the script on the connected Pico. Instead I recommend the run button contributed by the extension in the toolbar, the context menu or as command in the command palette) |
@paulober you solved my issue. I was using the regular "Run" command at the top. The one in the toolbar works fine! |
Hello, I am a beginner here. Can I ask some basic questions? I am using the micropython plugin to write code, and I have created a new project. However, I am facing a problem where modules located in the same directory as the project cannot be imported. When I run the code, it gives an error saying that the module cannot be found.
The text was updated successfully, but these errors were encountered: