目前python版本为3.11.2 用pip后 Using cached wxPython-4.2.0.tar.gz (71.0 MB)
PS C:\Users\admin> pip install wxpython
Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) ... done
Collecting pillow
Downloading Pillow-9.5.0-cp311-cp311-win_amd64.whl (2.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 970.3 kB/s eta 0:00:00
Collecting six
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting numpy
Downloading numpy-1.24.2-cp311-cp311-win_amd64.whl (14.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.8/14.8 MB 69.0 kB/s eta 0:00:00
Installing collected packages: six, pillow, numpy, wxpython
DEPRECATION: wxpython is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not
installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
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
╰─> [49 lines of output]
D:\python\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(
D:\python\Lib\site-packages\setuptools\config\setupcfg.py:516: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
D:\python\Lib\site-packages\setuptools\dist.py:328: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
D:\python\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.
"D:\python\python.exe" -u build.py build
Will build using: "D:\python\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 '"D:\python\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 "D:\python\Lib\site-packages\setuptools\msvc.py", line 1103, in __init__
self.si = SystemInfo(self.ri, vc_ver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\setuptools\msvc.py", line 579, in __init__
vc_ver or self._find_latest_available_vs_ver())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\Lib\site-packages\setuptools\msvc.py", line 593, in _find_latest_available_vs_ver
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: No Microsoft Visual C++ version found
Finished command: build_wx (0.703s)
Finished command: build (0.703s)
Command '"D:\python\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.
这种情况应该怎么办?