Page 1 of 1

PyCharm MicroPython pyb module?

Posted: Tue May 29, 2018 10:15 pm
by kwiley
I found the MicroPython PyCharm plugin, installed it, and activated it for my project, but references to the pyb module are still unrecognized in my code. I realize pyb isn't really part of MicroPython native, but I also activated the plugin's Pyboard option under the Languages & Frameworks settings (and of course I selected the Enable MicroPython support checkbox). It still doesn't recognize the pyb module in my code however.

Does anyone what I'm missing here?

Thanks.

Re: PyCharm MicroPython pyb module?

Posted: Tue May 29, 2018 11:18 pm
by dhylands
The linter is looking on the host platform for the pyb module, which it can't find.

You can do something like this: https://github.com/dastultz/micropython ... master/lib which introduces a dummy pyb module which typically makes the linter happy.

Re: PyCharm MicroPython pyb module?

Posted: Wed May 30, 2018 8:57 am
by nmz787
I had to mock a few other files too, to get my code to import without error, and helped me sort out weird errors that MicroPython wasn't raising exceptions for (I think the last had to do with fancy/non-standard quotation characters that somehow made it into my code file after pasting in comments from a PDF).
https://gist.github.com/nmz787/771774b5 ... 36e3006352

Re: PyCharm MicroPython pyb module?

Posted: Wed May 30, 2018 4:35 pm
by kwiley
Thanks. The dummy file will be good enough for now, since I only intend to run the code on the PyBoard. I am curious about options of integrating PyCharm with the PyBoard for tightly coupled development, but one step at a time. It's nice just to be able to develop code in a completed and checked fashion (as opposed to writing code in a text editor and repeatedly copy/pasting it into the PyBoard's terminal or copying a code file to the PyBoard and rebooting the board).

Cheers!