按照书上的安装方法出现如下提示,看不懂,求教!
C:\Users\Administrator.SC-201911110847>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 d:\python\python310\lib\site-packages (from wxPython) (8.4.0)
Requirement already satisfied: six in d:\python\python310\lib\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in d:\python\python310\lib\site-packages (from wxPython) (1.21.5)
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: Command errored out with exit status 1:
command: 'D:\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator.SC-201911110847\\AppData\\Local\\Temp\\pip-install-i7ngff8n\\wxpython_474be02b16ee4585b61b1a245da3b4b4\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator.SC-201911110847\\AppData\\Local\\Temp\\pip-install-i7ngff8n\\wxpython_474be02b16ee4585b61b1a245da3b4b4\\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 'C:\Users\Administrator.SC-201911110847\AppData\Local\Temp\pip-record-crcb_ul1\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Python310\Include\wxPython'
cwd: C:\Users\Administrator.SC-201911110847\AppData\Local\Temp\pip-install-i7ngff8n\wxpython_474be02b16ee4585b61b1a245da3b4b4\
Complete output (49 lines):
D:\Python\Python310\lib\site-packages\setuptools\dist.py:697: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
warnings.warn(
running install
running build
C:\Users\Administrator.SC-201911110847\AppData\Local\Temp\pip-install-i7ngff8n\wxpython_474be02b16ee4585b61b1a245da3b4b4\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: "D:\Python\Python310\python.exe"
3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.1.1
Running command: build
Running command: build_wx
Command '"D:\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 "D:\Python\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "D:\Python\Python310\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall
return EnvironmentInfo(arch, ver).return_env()
File "D:\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env
[self.VCIncludes,
File "D:\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes
return [join(self.si.VCInstallDir, 'Include'),
File "D:\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.492s)
Finished command: build (0.492s)
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\Python310\python.exe" -u build.py build
Command '"D:\Python\Python310\python.exe" -u build.py build' failed with exit code 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator.SC-201911110847\\AppData\\Local\\Temp\\pip-install-i7ngff8n\\wxpython_474be02b16ee4585b61b1a245da3b4b4\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator.SC-201911110847\\AppData\\Local\\Temp\\pip-install-i7ngff8n\\wxpython_474be02b16ee4585b61b1a245da3b4b4\\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 'C:\Users\Administrator.SC-201911110847\AppData\Local\Temp\pip-record-crcb_ul1\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Python310\Include\wxPython' Check the logs for full command output.