PyCharm and CircuitPython

PyCharm is a full featured Python editor including super helpful things like code completion and error highlighting. It's available for free in a Community Edition.

Recently, they added a MicroPython plugin that enables use of the REPL from within the editor. CircuitPython isn't officially supported, however we have some steps to make it work!

Download and install PyCharm on your computer. Then, plug in your board and follow the steps below!

Create a new project or open an existing project.

Open PyCharm Preferences/Settings. Click on Plugins and search for "micropython". Click on Search in repositories.

Click Install.

Once it's finished installing, click Restart PyCharm.

Once restarted, open Preferences/Settings. Click on Languages & Frameworks and choose MicroPython.

Choose your project directory from the list.

Choose ESP8266 from the list of Device Names.

 

For now, you'll use this option regardless of what board you are using.

You'll need to manually add your Device Path. This is the path to your serial connection. Once entered, click Ok.

 

 

If you need help finding your device's serial connection, see Advanced Serial Console on Windows and Advanced Serial Console on Mac and Linux.

Now, open any Python file from the project directory you chose.

 

A message may pop up stating, "Packages required for ESP8266 support not found," followed by a list of packages. Click Install Requirements on this message to install the required packages.

Now, you can click on the Tools menu and you should find a MicroPython menu. Highlight this, and you'll find MicroPython REPL available.

The REPL will open at the bottom of the PyCharm window. Now you can begin coding!

If you want to use the built in REPL with a different board, you'll need to go in and change the Device Path to the path that matches the board you'd like to use.

To change the Device Path, follow the steps above starting with manually adding the Device Path.

The PyCharm REPL will not work with multiple boards at the same time. Going through the steps above on multiple projects did not result in consistently being able to open multiple REPL connections at the same time.

The "Remove All Files from MicroPython Device" and "Flash Project" features do not work, but could corrupt your board. Do not try to use these functions. Remember, CircuitPython isn't officially supported and the steps above are a workaround.
This guide was first published on Dec 19, 2017. It was last updated on Sep 21, 2018. This page (PyCharm and CircuitPython) was last updated on Feb 02, 2018.