KiCad Python development under Windows

I have written a few plugins for KiCad using a painful setup not much different from typing into IDLE. I would like to do a lot more sophisticated work, which requires a better setup.

I am looking for guidance setting-up a solid Python/KiCad development environment under Windows 10, preferably using Pycharm Professional or VSCode if necessary. Any articles or posts I’ve been able to find on the subject are pre KiCad 6.

Just point your VSCode to python.exe inside kicad’s bin folder. It should do the rest easily. Similarly in pycharm/idea add a python environment by pointing to existing installation and select python in kicad’s folder.
I described this process with a few more details here: Getting started using Python Scripts - #8 by qu1ck
It’s for kicad 5 but same works for 6.

1 Like

Similarly for VSCode press Ctrl-P and run “Python select interpreter” command.

image

As you can see I have selected here python from nightly build of kicad but you can enter any path.
VSCode will then parse pcbnew module as it’s on pythonpath for that interpreter.

1 Like

It had to be that simple…

Just got around to looking at this. BTW, the keyboard shortcut in VSCode is Ctrl+Shift+P. Also, it did not surface the KiCad interpreter, just other Python interpreters I have on the machine. I just pasted the path by hand in Settings. Will mess with it some more in the coming weeks. Not sure if I need to make VSCode aware of wxPython and other libraries. Will figure it out.

Thanks.