Kicad 5 and python 3

Hello I am interested to run some python scripts for Kicad (KiKit) and only work in python 3.
I downloaded last Kicad version and I see that the python console is still in python 2.7, no… nothing works.

How can I use Kicad python scripting with Python 3??

Thanks!

Install Linux
:slight_smile:

In the KiCon 2020 video from yesterday it was mentioned that the Linux versions of KiCad already uses Python3 (for maybe already half a year or so, maybe longer) while there are still some troubles with libraries for Windows and McIntosh.

Application: KiCad
Version: 5.1.7-a382d34a8~87~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux 5.4.0-48-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.68.0
Compiler: GCC 9.3.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

I run Kicad 5.1.7 under Debian Buster 64-bit linux.

Application: KiCad
Version: 5.1.7+dfsg1-1~bpo10+1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.67.0
OpenCASCADE Technology: 7.3.0
Curl: 7.64.0
Compiler: GCC 8.3.0 with C++ ABI 1013
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=OFF
KICAD_USE_OCC=ON
KICAD_SPICE=ON

But I don’t have Python 3.X.
I am not a Python programmer. That is probably why I never noticed until now.

$ python --version
Python 2.7.16

Does this make any difference whatsoever to any aspect of or functionality of Kicad?

I think you do. Try python3 --version.

If you have Debian, you have Python3.
Just try:

$ python3 --version

But it does not matter much probably. As programs often do, KiCad probably comes with it’s own python version baked in somewhere, to be independent on external programs.

Also note this line in your build settings:

Note:
I recently did a clean install of Linux Mint, and there was no “python”. I had to explicitly choose between python2 or python3, so I made a symbolic link for “python” to point to python3, as python 2 is officially obsolete since 2020-01-01. Just a week ago I read on the Linux Mint forum of somewone who updated to Mint 20, and he had apparently still “python” pointing to python2.

Hello all,

It looks like starting at Kicad V5 they install python 3.x but only in Linux! Not in Windows or MacOS.

So some people that works in Linux created python tools that at the end only work in Linux (for the moment)

So I will have to wait until Kicad is released with Python 3.X for windows.

Thanks guys!

$ python3 --version
Python 3.7.3

Yep. Thanks for the explanation, @paulvdh.