wxPython not installing via PIP on Apple Silicon M1 Max

Have a project that is written in Python 3.8.x and wxPython. It was developed on an Apple MacBookPro (Intel-based). wxPython installed via PIP inside a virtual environment without problems. Life was good.

Then I get a new Apple MacBookPro (M1 Apple Silicon / ARM) based system. Installed Python3 via Homebrew, created project space and a new virtual environment via python3 -m venv .venv. The IDE of choice is Visual Studio Code (VSCode) with the Python plugin installed.

When running the following command in VSCode with the active virtual environment .venv for the project workspace, I see errors like:

configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

What is the “use ‘–host’” referring to? The pip command when installing wxPython or some internal C compiler setting?

Here is the full error trace when running pip install -U wxPython inside the .venv environment on a Apple Silicon M1 system:

(.venv) system@local MyProjectName % pip install -U wxPython
Collecting wxPython
  Using cached wxPython-4.1.1.tar.gz (66.0 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in ./.venv/lib/python3.8/site-packages (from wxPython) (8.4.0)
Requirement already satisfied: six in ./.venv/lib/python3.8/site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in ./.venv/lib/python3.8/site-packages (from wxPython) (1.21.4)
Building wheels for collected packages: wxPython
  Building wheel for wxPython (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: '/Users/Dev/Projects/MyProjectName/.venv/bin/python3' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"'; __file__='"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-wheel-8jjcyj2e
       cwd: /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/
  Complete output (260 lines):
  /Users/Dev/Projects/MyProjectName/.venv/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /Users/Dev/Projects/MyProjectName/.venv/lib/python3.8/site-packages/setuptools/dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  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.
  
  "/Users/Dev/Projects/MyProjectName/.venv/bin/python3" -u build.py build
  Will build using: "/Users/Dev/Projects/MyProjectName/.venv/bin/python3"
  3.8.9 (default, Aug  3 2021, 19:21:54)
  [Clang 13.0.0 (clang-1300.0.29.3)]
  Python's architecture is 64bit
  cfg.VERSION: 4.1.1
  
  Running command: build
  Running command: build_wx
  wxWidgets build options: ['--wxpython', '--unicode', '--osx_cocoa']
  Configure options: ['--enable-unicode', '--with-osx_cocoa', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-macosx-version-min=10.10']
  /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/configure --enable-unicode --with-osx_cocoa --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-macosx-version-min=10.10
  checking build system type... arm-apple-darwin21.1.0
  checking host system type... arm-apple-darwin21.1.0
  checking for toolkit... osx_cocoa
  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++... g++
  checking whether we are using the GNU C++ compiler... yes
  checking whether g++ accepts -g... yes
  checking whether we are using the Intel C++ compiler... no
  checking whether we are using the IBM xlC C++ compiler... no
  checking whether g++ supports C++11 features with -std=gnu++11... yes
  checking for ar... ar
  checking if C compiler (gcc -mmacosx-version-min=10.10) works with SDK/version options... yes
  checking if C++ compiler (g++ -std=gnu++11 -mmacosx-version-min=10.10) works with SDK/version options... yes
  checking if CoreFoundation/CFBase.h is usable... yes
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for langinfo.h... yes
  checking for wchar.h... yes
  checking for sys/select.h... yes
  checking for cxxabi.h... yes
  checking for an ANSI C-conforming const... yes
  checking for inline... inline
  checking size of short... 2
  checking size of void *... 8
  checking size of int... 4
  checking size of long... 8
  checking size of size_t... 8
  checking size of long long... 8
  checking size of wchar_t... 4
  checking for va_copy... yes
  checking for _FILE_OFFSET_BITS value needed for large files... 64
  checking if large file support is available... yes
  checking for _LARGEFILE_SOURCE value needed for large files... no
  checking whether byte ordering is bigendian... no
  checking for __sync_fetch_and_add and __sync_sub_and_fetch builtins... yes
  checking for libraries directories... /usr/lib
  checking for cos... yes
  checking for floor... yes
  checking if floating point functions link without -lm... yes
  checking for pkg-config... no
  configure: WARNING: Defaulting to the builtin regex library for Unicode build.
  checking for zlib.h >= 1.1.4... no
  checking for zlib.h... (cached) no
  configure: WARNING: zlib library not found or too old, will use built-in instead
  checking whether zlib.h file exists... yes
  checking for png.h > 0.90... no
  checking for png.h... (cached) no
  configure: WARNING: system png library not found or too old, will use built-in instead
  checking whether png.c file exists... yes
  checking for jpeglib.h... no
  configure: WARNING: system jpeg library not found, will use built-in instead
  checking whether jpeglib.h file exists... yes
  checking lzma.h usability... no
  checking lzma.h presence... no
  checking for lzma.h... no
  checking for jbg_dec_init in -ljbig... no
  checking for LIBTIFF... not found via pkg-config
  checking for tiffio.h... no
  configure: WARNING: system tiff library not found, will use built-in instead
  checking whether tiff.h file exists... yes
  checking for expat.h... yes
  checking if expat.h is valid C++ header... yes
  checking for XML_ParserCreate in -lexpat... yes
  checking for X11/Xlib.h... no
  checking for X11/XKBlib.h... no
  checking if the linker accepts --version-script... no
  checking for symbols visibility support... yes
  checking for broken libstdc++ visibility... no
  checking for mode_t... yes
  checking for off_t... yes
  checking for pid_t... yes
  checking for size_t... yes
  checking for ssize_t... yes
  checking if size_t is unsigned int... no
  checking if size_t is unsigned long... yes
  checking if wchar_t is separate type... yes
  checking for pw_gecos in struct passwd... yes
  checking for wcslen... yes
  checking for wcsftime... yes
  checking for mbstate_t... yes
  checking for wcsrtombs... yes
  checking for snprintf... yes
  checking for vsnprintf... yes
  checking for vsscanf... yes
  checking for vsnprintf declaration... yes
  checking if vsnprintf declaration is broken... no
  checking for snprintf declaration... yes
  checking if snprintf supports positional arguments... yes
  checking for vsscanf declaration... yes
  checking if vsscanf() declaration is broken... no
  checking for putws... no
  checking for fputws... yes
  checking for wprintf... yes
  checking for vswprintf... yes
  checking for vswscanf... yes
  checking for _vsnwprintf... no
  checking for fsync... yes
  checking for round... yes
  checking for iconv... yes
  checking if iconv needs const... no
  checking for sigaction... yes
  checking for sa_handler type... int
  checking for backtrace()... yes
  checking for library containing backtrace... none required
  checking for __cxa_demangle() in <cxxabi.h>... yes
  checking for mkstemp... yes
  checking for statfs... yes
  checking for statfs declaration... yes
  checking for fcntl... yes
  checking for setenv... yes
  checking for unsetenv... yes
  checking for uname... yes
  checking for strtok_r... yes
  checking for inet_addr... yes
  checking for inet_aton... yes
  checking for fdopen... yes
  checking for sysconf... yes
  checking for getpwuid_r... yes
  checking for getgrgid_r... yes
  checking for the pthreads library -lpthread... yes
  checking if more special flags are required for pthreads... no
  checking for pthread_setconcurrency... yes
  checking for pthread_cleanup_push/pop... yes
  checking for sched.h... yes
  checking for sched_yield... yes
  checking for pthread_attr_getschedpolicy... yes
  checking for pthread_attr_setschedparam... yes
  checking for sched_get_priority_max... yes
  checking for pthread_cancel... yes
  checking for pthread_mutex_timedlock... no
  configure: WARNING: wxMutex::LockTimeout() will not work
  checking for pthread_attr_setstacksize... yes
  checking for pthread_mutexattr_t... yes
  checking for pthread_mutexattr_settype declaration... yes
  checking for abi::__forced_unwind() in <cxxabi.h>... no
  checking for localtime_r... yes
  checking for gmtime_r... yes
  checking how many arguments gethostbyname_r() takes... can't tell
  checking for gethostbyname... yes
  checking how many arguments getservbyname_r() takes... no
  checking for getservbyname... yes
  checking for dlopen... yes
  checking for dladdr... yes
  checking whether inotify is usable... no
  checking for sys/event.h... yes
  checking for SNDCTL_DSP_SPEED in sys/soundcard.h... no
  checking xlocale.h usability... yes
  checking xlocale.h presence... yes
  checking for xlocale.h... yes
  checking for locale_t... yes
  checking for sys/epoll.h... no
  configure: WARNING: sys/epoll.h not available, wxEpollDispatcher disabled
  checking for gettimeofday... yes
  checking whether gettimeofday takes two arguments... yes
  checking for timezone variable in <time.h>... timezone
  checking for localtime... yes
  checking for tm_gmtoff in struct tm... yes
  checking for _NL_TIME_FIRST_WEEKDAY in langinfo.h... no
  checking for setpriority... yes
  checking for socket... yes
  checking what is the type of the third argument of getsockname... socklen_t
  checking what is the type of the fifth argument of getsockopt... socklen_t
  configure: WARNING: Dialup manager not supported on this platform... disabled
  checking for python... /Users/Dev/Projects/MyProjectName/.venv/bin/python3
  checking if AVKit is available... yes
  checking CXXWARNINGS for gcc -Woverloaded-virtual... -Woverloaded-virtual
  checking for a BSD-compatible install... /usr/bin/install -c
  checking for ranlib... ranlib
  checking whether ln -s works... yes
  checking whether make sets $(MAKE)... yes
  checking for ar... (cached) ar
  checking for strip... strip
  checking for nm... nm
  checking if make is GNU make... yes
  checking for gcc 3.1 or later... yes
  checking for dependency tracking method... gcc
  checking whether make sets $(MAKE)... (cached) yes
  checking whether catch.hpp file exists... yes
  === configuring in src/tiff (/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/build/wxbld/src/tiff)
  configure: running /bin/sh /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/src/tiff/configure '--prefix=/usr/local' --disable-option-checking  '--enable-unicode' '--with-osx_cocoa' '--enable-sound' '--enable-graphics_ctx' '--enable-display' '--enable-geometry' '--enable-debug_flag' '--enable-optimise' '--disable-debugreport' '--enable-uiactionsim' '--enable-autoidman' '--with-macosx-version-min=10.10' '--disable-jbig' '--disable-webp' '--disable-zstd' '--disable-lzma' '--enable-jpeg' '--srcdir=/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/src/tiff' --cache-file=
  checking build system type... arm-apple-darwin21.1.0
  checking host system type... arm-apple-darwin21.1.0
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/src/tiff/config/install-sh -c -d
  checking for gawk... no
  checking for mawk... no
  checking for nawk... no
  checking for awk... awk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking how to create a pax tar archive... gnutar
  checking whether to enable maintainer-specific portions of Makefiles... no
  checking for gcc... gcc -mmacosx-version-min=10.10
  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... configure: error: in `/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/build/wxbld/src/tiff':
  configure: error: cannot run C compiled programs.
  If you meant to cross compile, use `--host'.
  See `config.log' for more details
  configure: error: /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/src/tiff/configure failed for src/tiff
  Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "build.py", line 1510, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/buildtools/build_wxwidgets.py", line 372, in main
      exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
    File "/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/buildtools/build_wxwidgets.py", line 85, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0m23.44s)
  Finished command: build (0m23.44s)
  Command '"/Users/Dev/Projects/MyProjectName/.venv/bin/python3" -u build.py build' failed with exit code 1.
  ----------------------------------------
  ERROR: Failed building wheel for wxPython
  Running setup.py clean for wxPython
Failed to build wxPython
Installing collected packages: wxPython
    Running setup.py install for wxPython ... error
    ERROR: Command errored out with exit status 1:
     command: '/Users/Dev/Projects/MyProjectName/.venv/bin/python3' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"'; __file__='"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-record-hu50wtrm/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/Dev/Projects/MyProjectName/.venv/include/site/python3.8/wxPython'
         cwd: /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/
    Complete output (50 lines):
    /Users/Dev/Projects/MyProjectName/.venv/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
      warnings.warn(
    /Users/Dev/Projects/MyProjectName/.venv/lib/python3.8/site-packages/setuptools/dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
      warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
    running install
    /Users/Dev/Projects/MyProjectName/.venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    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.
    
    "/Users/Dev/Projects/MyProjectName/.venv/bin/python3" -u build.py build
    Will build using: "/Users/Dev/Projects/MyProjectName/.venv/bin/python3"
    3.8.9 (default, Aug  3 2021, 19:21:54)
    [Clang 13.0.0 (clang-1300.0.29.3)]
    Python's architecture is 64bit
    cfg.VERSION: 4.1.1
    
    Running command: build
    Running command: build_wx
    wxWidgets build options: ['--wxpython', '--unicode', '--osx_cocoa']
    Configure options: ['--enable-unicode', '--with-osx_cocoa', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-macosx-version-min=10.10']
    /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/ext/wxWidgets/configure --enable-unicode --with-osx_cocoa --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-macosx-version-min=10.10
    checking build system type... arm-apple-darwin21.1.0
    checking host system type... arm-apple-darwin21.1.0
    checking for toolkit... osx_cocoa
    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... configure: error: in `/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/build/wxbld':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details
    Error running configure
    ERROR: failed building wxWidgets
    Traceback (most recent call last):
      File "build.py", line 1510, in cmd_build_wx
        wxbuild.main(wxDir(), build_options)
      File "/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/buildtools/build_wxwidgets.py", line 372, in main
        exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
      File "/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/buildtools/build_wxwidgets.py", line 85, in exitIfError
        raise builder.BuildError(msg)
    buildtools.builder.BuildError: Error running configure
    Finished command: build_wx (0m5.814s)
    Finished command: build (0m5.814s)
    Command '"/Users/Dev/Projects/MyProjectName/.venv/bin/python3" -u build.py build' failed with exit code 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: '/Users/Dev/Projects/MyProjectName/.venv/bin/python3' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"'; __file__='"'"'/private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-install-jm73uoks/wxpython_2050e380cbcf449482f47c041513b558/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n_/9br5lnpx1r3bd6p_k4v5s1v40000gn/T/pip-record-hu50wtrm/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/Dev/Projects/MyProjectName/.venv/include/site/python3.8/wxPython' Check the logs for full command output.

I am stuck and all my reading on the wxPython webpage, didn’t really point me to any solutions.

My questions are:

  • Are these errors the result of wxPython 4.1.1 not compatible with Apple Silicon M1 platforms? Is anyone successfully running wxPython within a .venv setup?
  • Are these errors the result of missing librarys that I need to install via Homebrew on the host itself, outside the .venv?
  • Are these errors the result of missing python extensions within the .venv that wxPython requires to compile/build?
1 Like

Presumably because the last release of wxPython was quite a while ago (Nov 2020 - over a year ago now) and there is nothing uploaded to PyPI that supports M1.

Christmas is coming so hopefully Santa is going to come :wink:

@cybercitizen443: Did you find any solution to the issue?

Any update on this? Unfortunately Santa forgot us @Brendan_Simon_eTRIX

Although I’m not an expert on Python, I tried to build the library by myself (python 3.8.11 using pyenv) but also had no luck. I followed this guide https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html to build version 4.0.7-post2 (because it’s the dependency I need to install robotframework-ride package) and also 4.1.1, but no luck…

On M1 I couldn’t install via pip too, but conda can install. Activate your venv and then install via conda:

conda activate myvenv

conda install wxPython

I am having the same problem, installing WxPython on an M1 MacBook Pro. I tried to post the listing of my unsuccessful attempt. But I got a message that as a new user I could not post more than 2 links. But I have no idea what qualifies as link, so I couldn’t demonstrate my problem.

Any updates? Wanted to give a +1 to the issue - I am unable to build wxPython on my Apple M1 Silicon using pip or conda

1 Like

+1 Also having this issue! No matter which environment I’m in I can’t seem to install on any silicon Mac.

This works for me:

export CFLAGS=-I/$(brew --prefix)/include
export CXXFLAGS=-I/$(brew --prefix)/include
pip install wxPython

I tried the flags, no go for me. :frowning:

Hi,
Any update regarding this case?
I fount this solution:
https://discuss.wxpython.org/t/failed-building-wheel-for-wxpython-macos-12-0-1/35700/4
but i think this version not stable.
Thanks

Currently using a snapshot build is the only option for getting a universal (multi-architecture) build for macOS.