It’s worth noting this isn’t purely a cython issue.
In a brand new conda environment using python 3.12, I installed the recommended version of cython and then tried installing wxpython, but the wheel still fails.
Is there any chance we’ll be getting a release sometime that includes the fixes for python 3.12 compatibility?
Output of my install attempt for the curious:
$ pip install cython==0.29.37 && pip install wxpython
Collecting wxpython
Using cached wxPython-4.2.1.tar.gz (73.7 MB)
Preparing metadata (setup.py) ... done
Collecting pillow (from wxpython)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.2 kB)
Collecting six (from wxpython)
Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Using cached pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.5 MB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: wxpython
Building wheel for wxpython (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [77 lines of output]
running bdist_wheel
running build
WARNING: Building this way assumes that all generated files have been
generated already. If that is not the case then use build.py directly
to generate the source and perform the build stage. You can use
--skip-build with the bdist_* or install commands to avoid this
message and the wxWidgets and Phoenix build steps in the future.
"/home/ge2/miniforge3/envs/test/bin/python3.12" -u build.py build
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/build.py:43: DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.
from distutils.dep_util import newer, newer_group
Will build using: "/home/ge2/miniforge3/envs/test/bin/python3.12"
3.12.5 | packaged by conda-forge | (main, Aug 8 2024, 18:36:51) [GCC 12.4.0]
Python's architecture is 64bit
cfg.VERSION: 4.2.1
Running command: build
Running command: build_wx
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py:83: SyntaxWarning: invalid escape sequence '\d'
majorVersion = re.search("wx_major_version_number=(\d+)", configureText).group(1)
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py:84: SyntaxWarning: invalid escape sequence '\d'
minorVersion = re.search("wx_minor_version_number=(\d+)", configureText).group(1)
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py:89: SyntaxWarning: invalid escape sequence '\d'
releaseVersion = re.search("wx_release_number=(\d+)", configureText).group(1)
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py:428: SyntaxWarning: invalid escape sequence '\s'
setupText, subsMade = re.subn(flag + "\s+?\d", "%s %s" % (flag, flags[flag]), setupText)
wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for toolkit... gtk
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether we are using the Intel C compiler... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc needs -traditional... no
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking whether we are using the Intel C++ compiler... no
checking whether we are using the Sun C++ compiler... no
configure: error: C++ compiler is needed to build wxWidgets
Error running configure
ERROR: failed building wxWidgets
Traceback (most recent call last):
File "/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/build.py", line 1563, in cmd_build_wx
wxbuild.main(wxDir(), build_options)
File "/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py", line 379, in main
exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
File "/tmp/pip-install-9qirq6bk/wxpython_52719d22b48244bfa8302f19ec60996b/buildtools/build_wxwidgets.py", line 72, in exitIfError
raise builder.BuildError(msg)
buildtools.builder.BuildError: Error running configure
Finished command: build_wx (0.912s)
Finished command: build (0.912s)
Command '"/home/ge2/miniforge3/envs/test/bin/python3.12" -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: Failed building wheel for wxpython
Running setup.py clean for wxpython
Failed to build wxpython
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (wxpython)