Ubunt 20.04 & Python

Hi All

After updating to Ubuntu 20.04, I (and all my colleagues) can’t run anything python related in Kicad anymore. When opening the Python Console in PCBnew, I get the error message “Error: unable to create the Python Console”.
When running kicad from a terminal, I get the following error message:

Traceback (most recent call last):
File “”, line 1, in
File “/usr/share/kicad/scripting/kicad_pyshell/init.py”, line 17, in
import wx
File “/usr/lib/python3/dist-packages/wx/init.py”, line 12, in
version = wx.version.VERSION_STRING
AttributeError: module ‘wx’ has no attribute ‘version

I have tried the different reinstall suggestions found here on the forum but with no luck.
Is this a general issue with 20.04? Suggestions are more than welcome :slight_smile:
Thanks

Application: Pcbnew
Version: 5.1.5-br-unknown-nightly-202005092132, 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-39-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.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.65.3
Compiler: GCC 9.2.1 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

A nightly for 5.1.5 looks weird.

Especially because I have a stable 5.1.6.
Where do you get your KiCad version from?
I’m running Mint and I get my Kicad is from: “js-reynaud/kicad-5.1”
For some time the nightlies have version number 5.99, but I’m not sure if there are different kind of “current” nightlies.

Application: KiCad
Version: 5.1.6-c6e7f7d~86~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 5.3.0-59-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.5.0 with C++ ABI 1011

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

1 Like

I am not sure how you upgraded, but something is definitely not right. The latest in the ppa the 5.1 branch for 20.04 is 5.1.6-202005120818+c6e7f7d~86~ubuntu20.04.1 as mentioned by paulvdh by the time of writing this.

Im running the daily build 5.1 (wanna help testing, but can’t have file format changes).


I’ll give stable a try later and see if it’s a packaging issue

After updating to 20.04 make sure your ppa also points to focal subdirectory. Reinstall kicad after changing ppa.

1 Like

@Shack ping. sdfsdsdf

Seems to work fine with stable branch 5.1
@jsreynaud would you know why Python isn’t working with the 5.1 daily build?

Could you tell me more ? What ppa is working and what is not working ?

  • for 5.1 ppa is ppa:js-reynaud/kicad-5.1
  • for 5.1 daily build it’s js-reynaud/kicad-5-nightly

Could you confirm you compare those both version ? If not please give me details.

Hi @jsreynaud

When installing from the daily ppa (js-reynaud/kicad-5-nightly), the Python console is NOT working.
after purging kicad and reinstalling using stable PPA (ppa:js-reynaud/kicad-5.1) The python console is working again

Could you send me the “Version info” from about box (on version it’s not working only) ?

Version where it’s not working:

Application: Pcbnew
Version: 5.1.5-br-unknown-nightly-202005092132, 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-39-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.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.65.3
Compiler: GCC 9.2.1 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

Please check for update because on PPA last version is at least 5.1.5+nightly-202007081017+fd55b7b~86~ubuntu20.04.1.

Apparently I hadn’t updated the PPA since updating to 20.04, what a facepalm moment.
Thanks for the help everyone, and sorry for the noice.

Yes, I am sure that was what qu1ck tried to remind you early on. :eagle: :safety_vest:

1 Like

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