和朱衡约山韵 2022-05-14 15:47 采纳率: 33.3%
浏览 926

python用pip安装wxpython出现问题

我今天想着学着用一下wxpython ,然后发现用不了
下面是显示的问题

C:\Users\lcd35>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\lib\site-packages (from wxpython) (9.1.0)
Requirement already satisfied: six in d:\python\lib\site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in d:\python\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]
      D:\Python\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(
      D:\Python\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\lcd35\AppData\Local\Temp\pip-install-76e442kb\wxpython_2fa7da81c0814be0abc3206c513eb456\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\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 '"D:\Python\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\lib\distutils\msvc9compiler.py", line 371, in initialize

          vc_env = query_vcvarsall(VERSION, plat_spec)

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

          return EnvironmentInfo(arch, ver).return_env()

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

          [self.VCIncludes,

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

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

        File "D:\Python\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.954s)
      Finished command: build (0.954s)
      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
      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.

img

img

img

  • 写回答

3条回答 默认 最新

  • __程序喵__ 2022-05-30 20:36
    关注

    可能是Python版本问题。wxPython目前只支持到Python 3.9 ,如果是3.10需要把版本降至3.9及以下。

    评论

报告相同问题?

问题事件

  • 创建了问题 5月14日

悬赏问题

  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。