Downloading wxPython error with windows

Completely new to python, running command ‘pip install -U wxPython’ in Command line and this is the error I get:

C:\Users\Pikachu>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 c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython) (9.1.0)
Requirement already satisfied: six in c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython) (1.22.3)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is not installed.
Installing collected packages: wxPython
  Running setup.py install for wxPython ... error
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\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(
      C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      running build
      C:\Users\Pikachu\AppData\Local\Temp\pip-install-2h0mnbul\wxpython_9be5f59f193e4bde8c6b8e211acc73c3\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
        from distutils.dep_util import newer, newer_group
      Will build using: "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe"
      3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.1.1

      Running command: build
      Running command: build_wx
      Command '"C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe" -c "import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)"' failed with exit code 1.
      Traceback (most recent call last):

        File "<string>", line 1, in <module>

        File "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize

          vc_env = query_vcvarsall(VERSION, plat_spec)

        File "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

          return EnvironmentInfo(arch, ver).return_env()

        File "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

          [self.VCIncludes,

        File "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

          return [join(self.si.VCInstallDir, 'Include'),

        File "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 840, in VCInstallDir

          raise distutils.errors.DistutilsPlatformError(msg)

      distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      Finished command: build_wx (0.228s)
      Finished command: build (0.228s)
      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.

      "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build
      Command '"C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe" -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.

A wxpython wheel for python 3.10 is not yet available so it is trying to build from source (and it can’t since you don’t have the compiler installed).

You can get a snapshot build of 4.1.2a which supports py3.10 at Index of /Phoenix/snapshot-builds

Thank you, I tried running the command: ‘pip install https://wxpython.org/Phoenix/snapshot-builds/wxPython==4.1.2a1.dev5226+a843ed14-cp38-cp38-win32’ but it said

C:\Users\Pikachu>pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14-cp38-cp38-win32
ERROR: You must give at least one requirement to install (maybe you meant "pip install https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14-cp38-cp38-win32"?)

C:\Users\Pikachu>pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14
ERROR: You must give at least one requirement to install (maybe you meant "pip install https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14"?)

C:\Users\Pikachu>pip install https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14
Collecting https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14
  ERROR: HTTP error 404 while getting https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14
ERROR: Could not install requirement https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14 because of HTTP error 404 Client Error: Not Found for url: https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14 for URL https://wxpython.org/Phoenix/snapshot-builds/wxPython/wxPython==4.1.2a1.dev5226+a843ed14

Did I write the command wrong?

You will need to download the .whl file to your hard drive and install it locally with pip install <pathonyourharddrivetothewheel>

Not sure what I’m doing wrong, .whl file didn’t work for me so I also tried the tar.gz file, didn’t work also so I tried unzipping it and doing the command as is, and I still get errors:

C:\Users\Pikachu>pip install C:\Users\Pikachu\Downloads\wxPython-4.1.2a1.dev5226+a843ed14-cp38-cp38-win32.whl
ERROR: wxPython-4.1.2a1.dev5226+a843ed14-cp38-cp38-win32.whl is not a supported wheel on this platform.

C:\Users\Pikachu>pip install C:\Users\Pikachu\Downloads\wxPython-4.1.2a1.dev5226+a843ed14-cp38-cp38-win32
ERROR: Directory 'C:\\Users\\Pikachu\\Downloads\\wxPython-4.1.2a1.dev5226+a843ed14-cp38-cp38-win32' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

C:\Users\Pikachu>pip install C:\Users\Pikachu\Downloads\wxPython-4.1.2a1.dev5226+a843ed14.tar.gz
Processing c:\users\pikachu\downloads\wxpython-4.1.2a1.dev5226+a843ed14.tar.gz
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython==4.1.2a1.dev5226+a843ed14) (9.1.0)
Requirement already satisfied: six in c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython==4.1.2a1.dev5226+a843ed14) (1.16.0)
Requirement already satisfied: numpy in c:\users\pikachu\appdata\local\programs\python\python310\lib\site-packages (from wxPython==4.1.2a1.dev5226+a843ed14) (1.22.3)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is not installed.
Installing collected packages: wxPython
  Running setup.py install for wxPython ... error
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\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(
      C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      running build
      C:\Users\Pikachu\AppData\Local\Temp\pip-req-build-d1ne13zt\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
        from distutils.dep_util import newer, newer_group
      Traceback (most recent call last):
        File "C:\Users\Pikachu\AppData\Local\Temp\pip-req-build-d1ne13zt\build.py", line 48, in <module>
          from buildtools.wxpysip import sip_runner
        File "C:\Users\Pikachu\AppData\Local\Temp\pip-req-build-d1ne13zt\buildtools\wxpysip.py", line 20, in <module>
          from sipbuild.code_generator import (set_globals, parse, generateCode,
      ModuleNotFoundError: No module named 'sipbuild'
      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.

      "C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build
      Command '"C:\Users\Pikachu\AppData\Local\Programs\Python\Python310\python.exe" -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.

You need to download the wheel that matches your platform and python version. Right now, it looks like you have a wheel for python 3.8 on windows 32 bit

For example, if you are on 64 bit, python 3.10 you need to use the amd64 py-3.10 wheel

1 Like

You need too use the Python 3.10 wheel. The py38 ones are for Python
3.8.

1 Like

Thank you that worked!

To let pip choose which wheel to download you can give it the base URL with -f, plus the package name (or name==version) like normal pip commands. Something like this:

pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds  wxPython

That will fetch the correct package based on platform, architecture and Python version, if there is a match available.

1 Like

Hi , i have the same problem, i did the same command but it didnt work for me.

C:\Users\abder>pip install robotframework-ride
Collecting robotframework-ride
  Using cached robotframework_ride-1.7.4.2-py3-none-any.whl
Collecting PyPubSub
  Using cached Pypubsub-4.0.3-py3-none-any.whl (61 kB)
Requirement already satisfied: Pywin32 in c:\users\abder\appdata\local\programs\python\python310\lib\site-packages (from robotframework-ride) (304)
Collecting Pygments
  Using cached Pygments-2.12.0-py3-none-any.whl (1.1 MB)
Collecting wxPython<=4.0.7.post2
  Using cached wxPython-4.0.7.post2.tar.gz (68.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\users\abder\appdata\local\programs\python\python310\lib\site-packages (from wxPython<=4.0.7.post2->robotframework-ride) (9.1.1)
Requirement already satisfied: six in c:\users\abder\appdata\local\programs\python\python310\lib\site-packages (from wxPython<=4.0.7.post2->robotframework-ride) (1.16.0)
Requirement already satisfied: numpy in c:\users\abder\appdata\local\programs\python\python310\lib\site-packages (from wxPython<=4.0.7.post2->robotframework-ride) (1.22.4)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is not installed.
Installing collected packages: wxPython, PyPubSub, Pygments, robotframework-ride
  Attempting uninstall: wxPython
    Found existing installation: wxPython 4.1.2a1.dev5407+3134c914
    Uninstalling wxPython-4.1.2a1.dev5407+3134c914:
      Successfully uninstalled wxPython-4.1.2a1.dev5407+3134c914
  Running setup.py install for wxPython ... error
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      C:\Users\abder\AppData\Local\Programs\Python\Python310\lib\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(
      C:\Users\abder\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      running build
      C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
        from distutils.dep_util import newer, newer_group
      Will build using: "C:\Users\abder\AppData\Local\Programs\Python\Python310\python.exe"
      3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.0.7.post2

      Running command: build
      Running command: build_wx
      MSVC: <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

      C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe
      Traceback (most recent call last):
        File "C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py", line 2193, in <module>
          main(sys.argv[1:])
        File "C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py", line 206, in main
          function(options, args)
        File "C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py", line 1368, in cmd_build
          cmd_build_wx(options, args)
        File "C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py", line 1378, in cmd_build_wx
          checkCompiler()
        File "C:\Users\abder\AppData\Local\Temp\pip-install-xs5js8gk\wxpython_59b3ff7f164243a0b0de28dbd71f50ad\build.py", line 781, in checkCompiler
          env = eval(runcmd('"%s" -c "%s"' % (PYTHON, cmd), getOutput=True, echoCmd=False))
        File "<string>", line 1
          <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
          ^
      SyntaxError: invalid syntax
      Finished command: build_wx (0m4.306s)
      Finished command: build (0m4.306s)
      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.

      "C:\Users\abder\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build
      Command '"C:\Users\abder\AppData\Local\Programs\Python\Python310\python.exe" -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.
  WARNING: No metadata found in c:\users\abder\appdata\local\programs\python\python310\lib\site-packages
  Rolling back uninstall of wxpython
  Moving to c:\users\abder\appdata\local\programs\python\python310\lib\site-packages\wx\
   from C:\Users\abder\AppData\Local\Programs\Python\Python310\Lib\site-packages\~x
  Moving to c:\users\abder\appdata\local\programs\python\python310\lib\site-packages\wxpython-4.1.2a1.dev5407+3134c914.dist-info\
   from C:\Users\abder\AppData\Local\Programs\Python\Python310\Lib\site-packages\~xpython-4.1.2a1.dev5407+3134c914.dist-info
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\helpviewer.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\helpviewer.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\img2png.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\img2png.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\img2py.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\img2py.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\img2xpm.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\img2xpm.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\pycrust.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\pycrust.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\pyshell.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\pyshell.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\pyslices.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\pyslices.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\pyslicesshell.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\pyslicesshell.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\pywxrc.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\pywxrc.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\wxdemo.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\wxdemo.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\wxdocs.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\wxdocs.exe
  Moving to c:\users\abder\appdata\local\programs\python\python310\scripts\wxget.exe
   from C:\Users\abder\AppData\Local\Temp\pip-uninstall-ggh1gp87\wxget.exe
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: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the 'C:\Users\abder\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.

It looks like robotframework-ride has an explicit dependency on wxPython <= 4.0.7.post2. There are no Python 3.10 builds for that version of wxPython. You should go back to Python 3.9 for now.

IM brand new to this and i have no idea what im doing at all, can someone help me out

C:\Users\Nipeal>pip install C:\Users\Nipeal\Desktop\Phoenix\wxPython-4.1.1
Processing c:\users\nipeal\desktop\phoenix\wxpython-4.1.1
Preparing metadata (setup.py) … done
Requirement already satisfied: pillow in c:\python\python3101\lib\site-packages (from wxPython==4.1.1) (9.1.1)
Requirement already satisfied: six in c:\python\python3101\lib\site-packages (from wxPython==4.1.1) (1.16.0)
Requirement already satisfied: numpy in c:\python\python3101\lib\site-packages (from wxPython==4.1.1) (1.22.4)
Using legacy ‘setup.py install’ for wxPython, since package ‘wheel’ is not installed.
Installing collected packages: wxPython
Running setup.py install for wxPython … error
error: subprocess-exited-with-error

× Running setup.py install for wxPython did not run successfully.
│ exit code: 1
╰─> [51 lines of output]
C:\Python\Python3101\lib\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(
C:\Python\Python3101\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
running build
C:\Users\Nipeal\Desktop\Phoenix\wxPython-4.1.1\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.dep_util import newer, newer_group
Will build using: “C:\Python\Python3101\python.exe”
3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)]
Python’s architecture is 64bit
cfg.VERSION: 4.1.1

  Running command: build
  Running command: build_wx
  Command '"C:\Python\Python3101\python.exe" -c "import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)"' failed with exit code 1.
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:\Python\Python3101\lib\distutils\msvc9compiler.py", line 371, in initialize

      vc_env = query_vcvarsall(VERSION, plat_spec)

    File "C:\Python\Python3101\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

      return EnvironmentInfo(arch, ver).return_env()

    File "C:\Python\Python3101\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

      [self.VCIncludes,

    File "C:\Python\Python3101\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

      return [join(self.si.VCInstallDir, 'Include'),

    File "C:\Python\Python3101\lib\site-packages\setuptools\msvc.py", line 840, in VCInstallDir

      raise distutils.errors.DistutilsPlatformError(msg)

  distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  Finished command: build_wx (0.290s)
  Finished command: build (0.290s)
  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.

  "C:\Python\Python3101\python.exe" -u build.py build
  Command '"C:\Python\Python3101\python.exe" -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.

Try the pip command shown in the message above to install the current snapshot build.

1 Like

Thanks. I guess others missed your suggestion. Worked great for me!

I am also new with Python. I am trying to install the wxPython and got this error below. Could any expert please help?

C:\Users\Tom>pip install -U wxPython
Collecting wxPython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) … done
Requirement already satisfied: pillow in c:\users\Tom\appdata\local\programs\python\python311\lib\site-packages (from wxPython) (9.4.0)
Requirement already satisfied: six in c:\users\Tom\appdata\local\programs\python\python311\lib\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in c:\users\Tom\appdata\local\programs\python\python311\lib\site-packages (from wxPython) (1.24.2)
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
╰─> [35 lines of output]
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:788: UserWarning: Usage of dash-separated ‘license-file’ will not be supported in future versions. Please use the underscore name ‘license_file’ instead
warnings.warn(
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\config\setupcfg.py:516: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:328: 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.

  "C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -u build.py build
  Will build using: "C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe"
  3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  Command '"C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\msvc.py", line 1107, in __init__

      raise distutils.errors.DistutilsPlatformError(err)

  distutils.errors.DistutilsPlatformError: No suitable Microsoft Visual C++ version found
  Finished command: build_wx (0.462s)
  Finished command: build (0.463s)
  Command '"C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -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
Installing collected packages: wxPython
Running setup.py install for wxPython … error
error: subprocess-exited-with-error

× Running setup.py install for wxPython did not run successfully.
│ exit code: 1
╰─> [37 lines of output]
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:788: UserWarning: Usage of dash-separated ‘license-file’ will not be supported in future versions. Please use the underscore name ‘license_file’ instead
warnings.warn(
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\config\setupcfg.py:516: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:328: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\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.

  "C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -u build.py build
  Will build using: "C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe"
  3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  Command '"C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:\Users\Tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\msvc.py", line 1107, in __init__

      raise distutils.errors.DistutilsPlatformError(err)

  distutils.errors.DistutilsPlatformError: No suitable Microsoft Visual C++ version found
  Finished command: build_wx (0.463s)
  Finished command: build (0.464s)
  Command '"C:\Users\Tom\AppData\Local\Programs\Python\Python311\python.exe" -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.

There is no wheel (i.e. binary) available for Python 3.11, so you need a C compiler, or work with Python 3.10.

I was beginning to get aggravated, until I tried your suggestion here.

This is the only thing that worked for me, on a fairly fresh Windows 11 install.

You sir, not only saved my wxPython installation, you saved the day!

1,000x THANK YOU ! ! !