找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 1699|回复: 1

[求助] 新手wxpython安装失败,路过请留步!

1

主题

1

帖子

1

积分

贫民

积分
1
随便什么名字 发表于 2022-1-4 17:56:14 | 显示全部楼层 |阅读模式

下面是安装失败的代码,请告诉我为什么报错,谢谢.


C:\Users\jinliang>pip 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\jinliang\appdata\local\programs\python\python310\lib\site-packages (from wxpython) (9.0.0)
Requirement already satisfied: six in c:\users\jinliang\appdata\local\programs\python\python310\lib\site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in c:\users\jinliang\appdata\local\programs\python\python310\lib\site-packages (from wxpython) (1.22.0)
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: 'C:\Users\jinliang\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jinliang\\AppData\\Local\\Temp\\pip-install-9cv8s78x\\wxpython_893139ddb51d4d5fbc000e06b88d4399\\setup.py'"'"'; __file__='"'"'C:\\Users\\jinliang\\AppData\\Local\\Temp\\pip-install-9cv8s78x\\wxpython_893139ddb51d4d5fbc000e06b88d4399\\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\jinliang\AppData\Local\Temp\pip-record-_1ehni0r\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jinliang\AppData\Local\Programs\Python\Python310\Include\wxpython'
         cwd: C:\Users\jinliang\AppData\Local\Temp\pip-install-9cv8s78x\wxpython_893139ddb51d4d5fbc000e06b88d4399\
    Complete output (51 lines):
    C:\Users\jinliang\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 versi**. Please use the underscore name 'license_file' instead
      warnings.warn(
    C:\Users\jinliang\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\jinliang\AppData\Local\Temp\pip-install-9cv8s78x\wxpython_893139ddb51d4d5fbc000e06b88d4399\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\jinliang\AppData\Local\Programs\Python\Python310\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:\Users\jinliang\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\jinliang\AppData\Local\Programs\Python\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize

        vc_env = query_vcvarsall(VERSION, plat_spec)

      File "C:\Users\jinliang\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\jinliang\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

        [self.VCIncludes,

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

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

      File "C:\Users\jinliang\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.418s)
    Finished command: build (0.418s)
    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\jinliang\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build
    Command '"C:\Users\jinliang\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build' failed with exit code 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\jinliang\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jinliang\\AppData\\Local\\Temp\\pip-install-9cv8s78x\\wxpython_893139ddb51d4d5fbc000e06b88d4399\\setup.py'"'"'; __file__='"'"'C:\\Users\\jinliang\\AppData\\Local\\Temp\\pip-install-9cv8s78x\\wxpython_893139ddb51d4d5fbc000e06b88d4399\\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\jinliang\AppData\Local\Temp\pip-record-_1ehni0r\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jinliang\AppData\Local\Programs\Python\Python310\Include\wxpython' Check the logs for full command output.

回复

使用道具 举报

0

主题

1

帖子

1

积分

贫民

积分
1
秋天的太阳 发表于 2022-1-6 15:47:02 | 显示全部楼层
刚踩过坑,wxpyhon4.1.1暂不支持python3.10,换回python3.9.9吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表