The underlying cause is an issue which is yet to be determined.
Visual Studio 2019 build tools is installed. There may be something nonstandard in the Python environment causing Microsoft Visual C++ build environment not to be picked up.
PS C:\Users\Main> ."C:\Program Files (x86)\Python310-32\Scripts\pip.exe" install 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\main\appdata\roaming\python\python310-32\site-packages (from wxPython) (9.0.1)
Requirement already satisfied: six in c:\users\main\appdata\roaming\python\python310-32\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in c:\users\main\appdata\roaming\python\python310-32\site-packages (from wxPython) (1.22.3)
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
╰─> [51 lines of output]
C:\Program Files (x86)\Python310-32\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:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running bdist_wheel
running build
C:\Users\Main\AppData\Local\Temp\pip-install-6e5rpp3o\wxpython_124ccea23bac46d5afe02be653ca347f\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:\Program Files (x86)\Python310-32\python.exe"
3.10.3 (tags/v3.10.3:a342a49, Mar 16 2022, 12:53:06) [MSC v.1929 32 bit (Intel)]
Python's architecture is 32bit
cfg.VERSION: 4.1.1
Running command: build
Running command: build_wx
Command '"C:\Program Files (x86)\Python310-32\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:\Program Files (x86)\Python310-32\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall
return EnvironmentInfo(arch, ver).return_env()
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 1740, in return_env
[self.VCIncludes,
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes
return [join(self.si.VCInstallDir, 'Include'),
File "C:\Program Files (x86)\Python310-32\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.341s)
Finished command: build (0.341s)
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:\Program Files (x86)\Python310-32\python.exe" -u build.py build
Command '"C:\Program Files (x86)\Python310-32\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
╰─> [51 lines of output]
C:\Program Files (x86)\Python310-32\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:\Program Files (x86)\Python310-32\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\Main\AppData\Local\Temp\pip-install-6e5rpp3o\wxpython_124ccea23bac46d5afe02be653ca347f\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:\Program Files (x86)\Python310-32\python.exe"
3.10.3 (tags/v3.10.3:a342a49, Mar 16 2022, 12:53:06) [MSC v.1929 32 bit (Intel)]
Python's architecture is 32bit
cfg.VERSION: 4.1.1
Running command: build
Running command: build_wx
Command '"C:\Program Files (x86)\Python310-32\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:\Program Files (x86)\Python310-32\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall
return EnvironmentInfo(arch, ver).return_env()
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 1740, in return_env
[self.VCIncludes,
File "C:\Program Files (x86)\Python310-32\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes
return [join(self.si.VCInstallDir, 'Include'),
File "C:\Program Files (x86)\Python310-32\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.341s)
Finished command: build (0.341s)
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:\Program Files (x86)\Python310-32\python.exe" -u build.py build
Command '"C:\Program Files (x86)\Python310-32\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
."C:\Program Files (x86)\Python310-32\Scripts\pip.exe" install wxPython
Microsoft Visual C++ 14.2 or greater is required
The underlying cause is an issue which is yet to be determined.
Visual Studio 2019 build tools is installed. There may be something nonstandard in the Python environment causing Microsoft Visual C++ build environment not to be picked up.
Microsoft C++ Build Tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/
Edit: look like its trying to compile for Python : 3.10 wxPython supports upto Python :: 3.9 no X86 on https://wxpython.org/Phoenix/snapshot-builds/