My OS is MX Linux 23, based on Debian 12, the default Python 3 version is 3.11.2. I installed the package python3-wxgtk4.0 through the package manager, everything worked fine. The version is ‘4.2.0 gtk3 (phoenix) wxWidgets 3.2.2’.
I have additionally installed Python 3.13.12 with pyenv and tried installing the latest version of wxPython there with pip install wxPython - failed at first, but then sort of succeeded, after installing the system libgtk-3-dev package. pip install wxPython was doing something for about 20 minutes (building from the sources, I assume) and then reported a successful installation of wxPython-4.2.5.
However, attempting to import wx gives the following error:
File "/home/<username>/bin/pyenv/versions/3.13.12/lib/python3.13/site-packages/wx/__init__.py", line 17, in <module>
from wx.core import *
File "/home/<username>/bin/pyenv/versions/3.13.12/lib/python3.13/site-packages/wx/core.py", line 12, in <module>
from ._core import *
ImportError: /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0: version `WXU_3.2.6' not found (required by /home/<username>/bin/pyenv/versions/3.1
3.12/lib/python3.13/site-packages/wx/_core.cpython-313-x86_64-linux-gnu.so)
There’s another file with that name: .../pyenv/versions/3.13.12/lib/python3.13/site-packages/wx/libwx_baseu-3.2.so.0 that was created during the installation and, I assume, is of the required version. How do I tell wxPython to use it instead of the one from /lib/...?
I don’t know if this is more about Pyenv than wxPython, but I’ve installed a few other modules that are not pure Python (i. e. also have binary libraries in their directories), and they seem to work fine.