Bugzilla – Bug 1228252
Please provide wxPython for Python 3.11
Last modified: 2024-07-26 05:19:44 UTC
Please include this for Python 3.11 as well as as many other libraries as are included with Python 3.6. I am finding it harder and harder to continue using Python 3.6 as more and more projects require later versions since 3.6 is obsolete.
I might add that wxPython does not install using pip3.11. I need wxPython for 3.11 due to trying to install DisplayCal, which does not work with Python 3.6 and requires wxWidgets. I also have other tools I use which need wxPython for Python > 3.6. I have wxWidgets 3.1.5 installed. pip3.11 install wxPython Defaulting to user installation because normal site-packages is not writeable Collecting wxPython Using cached wxPython-4.2.1.tar.gz (73.7 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: pillow in /usr/lib64/python3.11/site-packages (from wxPython) (9.5.0) Requirement already satisfied: six in /usr/lib/python3.11/site-packages (from wxPython) (1.16.0) Requirement already satisfied: numpy in /usr/lib64/python3.11/site-packages (from wxPython) (1.24.2) Building wheels for collected packages: wxPython ... If I try and build wxPython 4.1.1 like what is included with Python 3.6 I get the following error: pip3.11 install wxPython==4.1.1 Defaulting to user installation because normal site-packages is not writeable Collecting wxPython==4.1.1 Using cached wxPython-4.1.1.tar.gz (66.0 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: pillow in /usr/lib64/python3.11/site-packages (from wxPython==4.1.1) (9.5.0) Requirement already satisfied: six in /usr/lib/python3.11/site-packages (from wxPython==4.1.1) (1.16.0) Requirement already satisfied: numpy in /usr/lib64/python3.11/site-packages (from wxPython==4.1.1) (1.24.2) Building wheels for collected packages: wxPython ... [ 11/921] Compiling sip/cpp/sip_corewxLogTextCtrl.cpp ../../../../sip/siplib/siplib.c: In function ‘sip_api_get_frame’: ../../../../sip/siplib/siplib.c:13750:22: error: dereferencing pointer to incomplete type ‘struct _frame’ frame = frame->f_back; ^~ In file included from ../../../../ext/wxWidgets/include/wx/defs.h:45:0, from ../../../../ext/wxWidgets/include/wx/wx.h:14, from ../../../../wx/include/wxPython/wxpy_api.h:41, from ../../../../sip/cpp/sipAPI_core.h:20845, from ../../../../sip/cpp/sip_corewxLogTextCtrl.cpp:10: ../../../../ext/wxWidgets/include/wx/platform.h:159:10: fatal error: wx/setup.h: No such file or directory #include "wx/setup.h" ^~~~~~~~~~~~ compilation terminated. Waf: Leaving directory `/tmp/pip-install-m6br_g83/wxpython_afc270d1d3644d2494de210c04616205/build/waf/3.1/gtk3' Build failed -> task in 'siplib' failed with exit status 1 (run with -v to display more information) -> task in '_core' failed with exit status 1 (run with -v to display more information) Command '"/usr/bin/python3.11" /tmp/pip-install-m6br_g83/wxpython_afc270d1d3644d2494de210c04616205/bin/waf-2.0.19 --wx_config=/tmp/pip-install-m6br_g83/wxpython_afc270d1d3644d2494de210c04616205/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/bin/python3.11" --out=build/waf/3.1/gtk3 configure build ' failed with exit code 1. Finished command: build_py (0m2.200s) Finished command: build (0m3.817s) Command '"/usr/bin/python3.11" -u build.py build' failed with exit code 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> wxPython note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. WARNING: There was an error checking the latest version of pip. Using the system version of wxWidgets seems to cause problems for both 4.1.1 and 4.2.0 since 4.1.1 has problems with Python 3.11 and 4.2.0 barfs on wxWidgets 3.1.5 and wants 3.2.x. I have built my own copy of wxWidgets 3.2.5 for 15.6 and Phoenix 4.2.1 installed under my ${HOME}.local directory, but it would be much nicer if this could be officially supported. As time progresses, it is increasingly difficult to use Python 3.6 and as many libraries that are supported with it should also support Python 3.11 if possible.
I've tried to patch the python-wxPython to build with python 3.11 in Leap 15.4 and greater. https://build.opensuse.org/package/show/home:dgarcia:branches:SUSE:SLE-15-SP4:Update/python-wxPython Can you try this version? If you can confirm that it's working correctly I can try to push to the SLE modern python stack or we can think about sending it just for Leap 15.6. I'll need to review the case to see what's better.
Something appears to be wrong. In trying to build KiCad with this wxPython I'm seeing this: -- Python module install path: lib64/python3.11/site-packages -- pybind11 v2.9.2 Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.11/site-packages/wx/__init__.py", line 17, in <module> from wx.core import * File "/usr/lib64/python3.11/site-packages/wx/core.py", line 12, in <module> from ._core import * ModuleNotFoundError: No module named 'wx._core' CMake Error at cmake/FindwxPython.cmake:56 (message): wxPython/Phoenix does not appear to be installed on the system Call Stack (most recent call first): CMakeLists.txt:944 (find_package) When I run /usr/lib64/python3.11/site-packages/wx/_core I get a segmentation fault. The version I built, 4.2.1 with a local build of wxWidgets 3.2.5 works for me.
I'm getting the following error: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.11/site-packages/wx/__init__.py", line 17, in <module> from wx.core import * File "/usr/lib64/python3.11/site-packages/wx/core.py", line 12, in <module> from ._core import * ModuleNotFoundError: No module named 'wx._core' I see the file under /usr/lib64/python3.11/site-packages/wx so I don't know why it isn't finding it. In the build I did of wxPython against a local version of wxWindows I see different files for the shared libraries. In my version, all of the shared library files end with .cpython-311-x86_64-linux-gnu.so: I'm guessing that Python is not finding the shared libraries which are missing the .so extension. I'm attempting to build my own RPM from your source, however, the dependency stage is extremely slow (on a fast SSD and 32 core system).
I built the source and again it's failing to load the shared libraries. I suspect it's because the filenames are incorrect.
(In reply to Aaron Williams from comment #5) > I built the source and again it's failing to load the shared libraries. I > suspect it's because the filenames are incorrect. I've fixed the package and now it should work. The problem was in the build script, I needed to tweak a bit to make compatible with python 3.11 so it create the right .so files with the corresponding suffix. https://build.opensuse.org/package/show/home:dgarcia:branches:SUSE:SLE-15-SP4:Update/python-wxPython If this version is working I'll try to send to SP4:Update so it'll be inherited in leap 15.5 and 15.6.