Partially initialized module 'wx' has no attribute '__version__'

I am trying to compile a full featured KiCad on my system using wxWidgets 3.1 to work around this old bug I am experiencing on Linux Mint.

While compiling with wxWidgets 3.1 works fine and solves most of my problems, I want to also compile in Python support.

What I have done:

  • Installed wxPython 4.1.1 via pip install wxPython==4.1.1
  • that dragged in wxWidgets 3.1.5 that is bleeding edge, so I cloned wxWidgets repository and compiled it
  • I have compiled KiCad using this configuration: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DwxWidgets_CONFIG_EXECUTABLE=/home/miceuz/Downloads/wxWidgets/buildgtk/wx-config -DKICAD_SCRIPTING_PYTHON3=ON -DKICAD_SCRIPTING_WXPYTHON=ON -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON -DKICAD_USE_EGL=ON -DCMAKE_INSTALL_PREFIX=/home/miceuz/kicad
  • so far so good, KiCad has compiled with no problems, I can run it

Now when I try to start python console I get

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/miceuz/kicad/share/kicad/scripting/kicad_pyshell/__init__.py", line 17, in <module>
    import wx
  File "/usr/local/lib/python3.8/dist-packages/wx/__init__.py", line 12, in <module>
    __version__ = wx.__version__.VERSION_STRING
AttributeError: partially initialized module 'wx' has no attribute '__version__' (most likely due to a circular import)

I have a single version of wxPython installed that is in /usr/local/lib/python3.8/dist-packages/wx/ my PYTHONPATH points to local kicad install directory: /home/miceuz/kicad/usr/share/kicad/scripting

I can import wx from python3.8 console with no problems, also running python /home/miceuz/kicad/share/kicad/scripting/kicad_pyshell/__init__.py gives no errors.

Now there are references about this problem here and there and all of them are a bit cryptic, one solution was refered as “uninstall wxPython from pip and do apt install python-wx” and another one says

Python3 is trying to import /usr/local/lib/python3.6/dist-packages/wx/init.py.
It’s on your /usr/local directory so it is not owned by packages of your distribution.
Remove your /usr/local… installation of wx and use python3-wxgtk4.0 from the distribution.

Can anyone explain to me the root cause of this problem and how can I fix it? Where does the KiCad python console expect wxPython to be located?

I have tried to hack it a bit by hardcoding the version string in wx/__init__.py:

import wx.__version__
__version__ = '4.1.1' #wx.__version__.VERSION_STRING

But now I get a different error while trying to start python console:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/miceuz/kicad/share/kicad/scripting/kicad_pyshell/__init__.py", line 17, in <module>
    import wx
  File "/usr/local/lib/python3.8/dist-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/usr/local/lib/python3.8/dist-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: /usr/local/lib/python3.8/dist-packages/wx/_core.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN13wxWindowIDRef6AssignEi, version WXU_3.1

First of all, don’t do any manual hacks to system packages, that’s a rabbit hole that will not end up anywhere good.
Second, verify that you have only one python or that at least what get’s invoked when you type “python” in console and what cmake cached as python location (look for PYTHON_EXECUTABLE in cmakecache.txt in build directory) are the same.

I don’t quite understand what this means

what do you mean by “dragged in” ? pip wouldn’t install wxwidgets, it’s not a python package.

In general I’m not sure that wxpython that you got from pip will play nicely with your custom wxwidgets. You may have to uninstall that and compile wxpython yourself and link it against your custom wxwidgets.

Yeah, I know, that hack was just to see what happens if trivial error is avoided.

I am sure it’s the same python that’s getting invoked - python3.8

At first I have compiled wxWidgets release 3.1.4, but pip install wxPython==4.1.1 takes a long time, it’s compiling something in the background and apearently that is wxWidgets 3.1.5 related because when I have tried cmaking kicad it complained that at least 3.1.5 is required. Then I cloned xwWidgets repo and build that, after this cmake was happy.

Try reinstalling wxpython if it compiles something it should link against your wxwidgets.

I have tried re-installing wxPython after compiling and installing wxWidgets. Also wxPython works just fine - it can create an application window, etc.

If wxpython works separately but not in kicad that means there is some difference in environment. Unfortunately it’s not trivial to troubleshoot. I would start by inspecting what sys.path is in python in terminal and in python in kicad. To do the latter you will likely have to inject some code somewhere here. You should be able to print to stdout or of that’s not captured at that stage then write to a text file for debug.

Hi, thanks for your suggestions. I have successfully injected:

    pcbnew_pyshell_one_step << "import sys\n";
    pcbnew_pyshell_one_step << "print(sys.path)\n";
    pcbnew_pyshell_one_step << "import kicad_pyshell\n";
    pcbnew_pyshell_one_step << "import wx\n";

In KiCad:

['/home/miceuz/kicad/bin', 
'/home/miceuz/kicad/usr/share/kicad/scripting', 
'/home/miceuz/kicad/lib/python3/dist-packages', 
'/usr/lib/python38.zip', 
'/usr/lib/python3.8', 
'/usr/lib/python3.8/lib-dynload', 
'/home/miceuz/.local/lib/python3.8/site-packages', 
'/usr/local/lib/python3.8/dist-packages', 
'/usr/lib/python3/dist-packages', 
'/usr/lib/python3.8/dist-packages', 
'.', 
'/home/miceuz/kicad/share/kicad/scripting', 
'/home/miceuz/kicad/share/kicad/scripting/plugins', 
'/home/miceuz/.config/kicad/5.99/scripting', 
'/home/miceuz/.config/kicad/5.99/scripting/plugins']

In python3:

['', 
'/usr/lib/python38.zip', 
'/usr/lib/python3.8', 
'/usr/lib/python3.8/lib-dynload', 
'/home/miceuz/.local/lib/python3.8/site-packages', 
'/usr/local/lib/python3.8/dist-packages', 
'/usr/lib/python3/dist-packages', 
'/usr/lib/python3.8/dist-packages']

Unfortunately I don’t see anything out of ordinary - none of paths that are in KiCad contain any wx directories or files except for /usr/local/lib/python3.8/dist-packages where wxWidgets was installed by pip

I have tried one experiment:

 ~/kicad/bin $ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path=['/home/miceuz/kicad/bin', 
... '/home/miceuz/kicad/usr/share/kicad/scripting', 
... '/home/miceuz/kicad/lib/python3/dist-packages', 
... '/usr/lib/python38.zip', 
... '/usr/lib/python3.8', 
... '/usr/lib/python3.8/lib-dynload', 
... '/home/miceuz/.local/lib/python3.8/site-packages', 
... '/usr/local/lib/python3.8/dist-packages', 
... '/usr/lib/python3/dist-packages', 
... '/usr/lib/python3.8/dist-packages', 
... '.', 
... '/home/miceuz/kicad/share/kicad/scripting', 
... '/home/miceuz/kicad/share/kicad/scripting/plugins', 
... '/home/miceuz/.config/kicad/5.99/scripting', 
... '/home/miceuz/.config/kicad/5.99/scripting/plugins']
>>> import kicad_pyshell
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/miceuz/kicad/share/kicad/scripting/kicad_pyshell/__init__.py", line 24, in <module>
    import pcbnew
  File "/home/miceuz/kicad/lib/python3/dist-packages/pcbnew.py", line 15, in <module>
    import _pcbnew
ImportError: /home/miceuz/kicad/lib/python3/dist-packages/_pcbnew.so: undefined symbol: _ZN14wxPlatformInfo14GetBitnessNameE9wxBitness, version WXU_3.1
>>> 

Am I correct to interpret this that _pcbnew.so does not know anything about WXU_3.1 symbols anyway?

This is ldd output:

ldd /home/miceuz/kicad/lib/python3/dist-packages/_pcbnew.so
	linux-vdso.so.1 (0x00007ffc22be0000)
	libwx_gtk3u_gl-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_gl-3.1.so.5 (0x00007fafdfc93000)
	libwx_gtk3u_aui-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_aui-3.1.so.5 (0x00007fafdfbe3000)
	libwx_gtk3u_html-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_html-3.1.so.5 (0x00007fafdfb00000)
	libwx_gtk3u_core-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_core-3.1.so.5 (0x00007fafdf22d000)
	libwx_baseu_net-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_baseu_net-3.1.so.5 (0x00007fafdf1c8000)
	libwx_baseu-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_baseu-3.1.so.5 (0x00007fafdeeff000)
	libwx_gtk3u_propgrid-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_propgrid-3.1.so.5 (0x00007fafdedea000)
	libwx_baseu_xml-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_baseu_xml-3.1.so.5 (0x00007fafdedd6000)
	libwx_gtk3u_stc-3.1.so.5 => /home/miceuz/Downloads/wxWidgets/buildgtk/lib/libwx_gtk3u_stc-3.1.so.5 (0x00007fafdeb13000)
	libpython3.8.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0 (0x00007fafde57d000)
	libkicad_3dsg.so.2.0.0 => /home/miceuz/Xaltura/kicad/build/release/3d-viewer/3d_cache/sg/libkicad_3dsg.so.2.0.0 (0x00007fafde50e000)
	libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fafddd5b000)
	libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007fafddc38000)
	libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fafddbd8000)
	libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fafddaaf000)
	libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fafdda1e000)
	libEGL.so.1 => /usr/lib/x86_64-linux-gnu/libEGL.so.1 (0x00007fafdda09000)
	libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007fafdd960000)
	libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fafdd8d8000)
	libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007fafdd866000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fafdd685000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fafdd536000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fafdd51b000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fafdd4f6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fafdd304000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fafe1eb0000)
	libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007fafdd1ff000)
	libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007fafdd1fa000)
	libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fafdd1e9000)
	libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007fafdd1d5000)
	libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007fafdd186000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007fafdd15e000)
	libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fafdcf7d000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fafdce40000)
	libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007fafdce39000)
	libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fafdce2c000)
	libXtst.so.6 => /usr/lib/x86_64-linux-gnu/libXtst.so.6 (0x00007fafdcc26000)
	libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007fafdcc0d000)
	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fafdcbc6000)
	libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fafdcb8e000)
	libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007fafdcb09000)
	libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007fafdca86000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fafdca6a000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fafdca64000)
	libsecret-1.so.0 => /usr/lib/x86_64-linux-gnu/libsecret-1.so.0 (0x00007fafdca03000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fafdc9da000)
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fafdc9aa000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fafdc9a5000)
	libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fafdc99f000)
	libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fafdc98d000)
	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fafdc985000)
	libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007fafdc977000)
	libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007fafdc94d000)
	libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007fafdc916000)
	libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007fafdc7e3000)
	libfribidi.so.0 => /usr/lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007fafdc7c6000)
	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fafdc6c1000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fafdc600000)
	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fafdc5fb000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fafdc5d1000)
	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fafdc5c2000)
	libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fafdc3b8000)
	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fafdc3a3000)
	libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007fafdc395000)
	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fafdc322000)
	libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007fafdc2f9000)
	libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fafdc2d8000)
	librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007fafdc2b8000)
	libssh.so.4 => /usr/lib/x86_64-linux-gnu/libssh.so.4 (0x00007fafdc248000)
	libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007fafdc235000)
	libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fafdc1a2000)
	libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fafdbecc000)
	libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fafdbe7f000)
	libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007fafdbe29000)
	liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007fafdbe18000)
	libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fafdbe08000)
	libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fafdbd50000)
	libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fafdbd1c000)
	libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007fafdbd17000)
	libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fafdbd0a000)
	libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fafdbcfb000)
	libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007fafdbcf6000)
	libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fafdbcf1000)
	libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fafdbcaf000)
	libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007fafdbca4000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fafdbc99000)
	libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007fafdbc8c000)
	libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007fafdbc2c000)
	libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fafdbc01000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fafdbbe5000)
	libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fafdbbc7000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fafdbbbc000)
	libwebp.so.6 => /usr/lib/x86_64-linux-gnu/libwebp.so.6 (0x00007fafdb953000)
	libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fafdb8aa000)
	libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007fafdb69c000)
	libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fafdb57e000)
	libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fafdb52b000)
	libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007fafdb4f4000)
	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fafdb4c7000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fafdb4c1000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fafdb4b9000)
	libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fafdb335000)
	libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fafdb15f000)
	libhogweed.so.5 => /usr/lib/x86_64-linux-gnu/libhogweed.so.5 (0x00007fafdb127000)
	libnettle.so.7 => /usr/lib/x86_64-linux-gnu/libnettle.so.7 (0x00007fafdb0ed000)
	libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fafdb069000)
	libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fafdaf8a000)
	libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fafdaf59000)
	libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fafdaf52000)
	libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fafdaf43000)
	libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fafdaf26000)
	libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007fafdaee1000)
	libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fafdaebc000)
	libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007fafdaeb2000)
	libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fafdae5b000)
	libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fafdadcb000)
	libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fafdadb1000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fafdad8c000)
	libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fafdacdd000)
	libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fafdaba7000)
	libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fafdab91000)
	libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fafdab8a000)
	libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007fafdab7c000)
	libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007fafdaae9000)
	libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007fafdaa42000)
	libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007fafdaa0a000)
	libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007fafda9f1000)
	liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fafda9ce000)
	libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007fafda9a4000)
	libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007fafda992000)
	libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007fafda944000)
	libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fafda81b000)
	libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fafda7e0000)

I believe you need to add location of _pcbnew.so to LD_LIBRARY_PATH to make it load properly. The error message may be misleading.

Regarding initial issue, this message partially initialized module 'wx' has no attribute '__version__' is usually not the first error, it happens on repeated attempt to import wx. Do you see any errors before that? Try launching pcbnew standalone from terminal to filter out irrelevant things. Pcbnew loads scripting on init. You can force it to import wx right away by adding a dummy script that does just that to ~/.kicad/scripting/plugins

Thanks for bearing with me, but the true mystery will be left unsolved. I dug deeper into wxpython code to find out that my wxwidgets build was missing some features, I have tried re-compiling it, to stumble on another thing that’s missing.

Finally I have uninstalled wxWidgets and wxPython, then cloned and built bleeding edge version of wxPython - it does compile wxWidgets also. And BAM, I have a working python console and the whole KiCad build on wxWidgets 3.1.

Glad you got it working.
But did it fix your Mint related GUI issues?

Yes it did, almost - it’s all reported in the issue linked above. All text field related issues are fixed, but Appearance manager’s Objects tab gets butchered if I change tabs. I.e. if Objects tab is the last one to be open and I close and start pcbnew (pcbnew remembers last tab that was open in Appearance manager) - it works fine, but if I change to other tab, say, “Layers” and then back to “Objects” - it’s totally butchered. I have tried poking around in the code around this place - nothing suspicious and MacOS workarounds don’t give any noticeable effect.

image

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