-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unable to use MicroPython modules in PyCharm #272
Comments
what kind issue you are facing ? |
A code example is this: led = Pin("LED", Pin.OUT) i = True This code works fine in Thonny but in PyCharm I get this error message: Connecting to COM6 This is better than it was before because before, it was complaining that it could not find the machine module but now it can't reach the board. In this case, the code was flashed to the board from Thonny successfully and without changing the port, it fails to do the same thing with the same code here in PyCharm. However, sometimes I get this output but the on board LED is not flashing: Connecting to COM6 Thanks for help in advance :) |
Whenever you're flashing the script using Pycharm, you have to make sure that no other application is connected. It appears as though you are attempting to flash while Thonny is connected. In Thonny, you can disconnect by going to the Run tab and clicking disconnect, then flash using PyCharm. Right now though, I believe that flashing the script is all that can be done. I haven't been able to get the REPL console to work regardless of the version matching as seen in #270. |
Hi, thanks for the response. Dsconnecting the board from Thonny didn't come to my mind but I tried it just now and the result is the same. I flashed the LED code from above to the board from Thonny succesfully, then disconnected the board in Thonny like you said, closed Thonny as well, tried to run the code in PyCharm (with MicroPython setup and the board detected) but the result is the same. Is it really possible that there is a problem with MicroPython in PyCharm? I know I could just give up and use Thonny since it works well but it's really bothering me and since I will have a lot of files, PyCharm will be more suitable for my situation. Here you can see a full screenshot Thanks :) |
@somniumLux According to your screenshot, there is nothing wrong with PyCharm. It successfully flashed the script to the board. The only thing micropython in PyCharm can't do is run the REPL console. My hope is that one of the Jetbrains developers are working on it. If you didn't see the pico flashing the light, then it's probably because of an error. Trying changing "LED" to 25 on line 4. The string only works for the pico w (I think) and you probably have the normal pico. Regardless, you should be able to see any errors in the script when you run it through Thonny. |
You are right, 25 should be used on the original Raspberry Pi Pico board but I'm using the Pico W and the code works in Thonny without any errors and the LED works. And yes, there are no errors in PyCharm and it says that the upload is done but the LED is not flashing. I don't have any other ideas other than that there is an issue with PyCharm here. I also conntacted their support so maybe I get a useful answer. Thank you :) |
Are there any limitations with MicroPython for PyCharm and other IDEs? Python scripts that work for my RPI Pico board work in Thonny but not in Pycharm and VS Code. Do certain modules have limitations or MicroPython in general because it is configured as by instructions.
Thanks :)
The text was updated successfully, but these errors were encountered: