question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run any micropython in PyCharm for ESP8266

See original GitHub issue

I was able to install the Micropython plugin into PyCharm 2020.2, however I can’t get even the simplest of examples to work. Example code:

import machine

def test(name) -> None:
    # Use a breakpoint in the code line below to debug your script.
    print(machine.freq())  # Press Ctrl+F8 to toggle the breakpoint.
    machine.freq(160000000)
    print(machine.freq())

if __name__ == '__main__':
    test()
Traceback (most recent call last):
  File "/home/jim/code/PycharmProjects/micropy-d1mini/main.py", line 6, in <module>
    import machine
ModuleNotFoundError: No module named 'machine'

Process finished with exit code 1

What step(s) am I missing to test and upload script to run?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jdjjmcommented, Oct 7, 2020

@AstroDrabb by the look of your error message it looks like you are trying to run micropython code with regular python. You must run it on a micropython enabled microcontroller. Make sure you have enabled micropython support for the project by doing Settings > Languages & Frameworks > MicroPython > Enable MicroPython Support If you right click on the file you have created you will now have the option to Run 'Flash main.py'. This will flash your script to your connected micropython device so it can run on there, not on your computer.

0reactions
hcet14commented, Jul 1, 2021

I have the same problems. I’m using ESP8266 and ESP32. See also https://forum.micropython.org/viewtopic.php?f=15&t=10771 github_issue github_issue_board1 github_issue_board2 Does the plugin try to load the wrong board?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run any micropython in PyCharm for ESP8266 #120
I was able to install the Micropython plugin into PyCharm 2020.2, however I can't get even the simplest of examples to work.
Read more >
Support ESP8266 MicroPython : PY-20308 - JetBrains YouTrack
A: Check if you have PyCharm 2017.1.x and that the MicroPython Support plugin is enabled in File | Settings | Plugins. If you...
Read more >
MicroPython in PyCharms: Basic Setup | by Andy Muehlhausen
In PyCharm, goto File>Settings>Languages & Frameworks>MicroPython . Check Enable MicroPython support. Select ESP8266 from the drop-down for ...
Read more >
PyCharm with ESP8266 & Micropython – - RNT Lab
Hi Sara,. I get this error: File “boot.py”, line 22, in <module> KeyboardInterrupt: 2. And in terminal: /Users/.
Read more >
Does PyCharm Micropython Plugin still work?
Firstly I can't flash files on to my pyboard(version ... I am running PyCharm 2018.3.2 (Community Edition) Build #PC-183.4886.43, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found