Run kicad's python/pip

Hello,

How can i use kicad’s python/pip? I would like to test a python script i am writing for kicad and i need to install external packages from pip

PS C:\Program Files\KiCad\bin> ./python.exe
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00001500 (most recent call first):
PS C:\Program Files\KiCad\bin> ./pip
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00002c20 (most recent call first):

Download 5.1.5-3 from official website, this issue is fixed in latest installer.

2 Likes

thanks, it works perfect now!

BTW going to python 3 will be anytime soon? or on kicad 6?

There is something going, but it seems not full completed…

Ubuntu 18.04 has kicad build with py3 and wxpython (required for action plugins). And from what I can gather py3 support on linux is not an issue. I don’t have a slightest clue how it is on macOs but on windows we are stuck with py2 if we want wxpython for action plugin. But if you can live without them there are py3 builds available which lack wxpython.

As I understand the issue on windows is wxpython. Currentl KiCad is built with gcc. wxpython3 can be built with gcc only against py2. In order to keep gcc KiCad would need to migrate ti wxpython4 which on windows can be build with gcc. Or wxpython3 would need to be patched to build with gcc agains py3. The third option (which I’d prefer) is to move to MSVC on windows. This would enable to keep on using wxpython3 with py3 and KiCad has been build already with MSVC (without any python support though). Additionally this might enable the use of prebuilt libraries such as numpy (which are also built with MSVC).

This is how I currently understand the things are.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.