日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

【wxPython 安装指南:error: legacy-install-failure】

發布時間:2023/12/15 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【wxPython 安装指南:error: legacy-install-failure】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

# 安裝環境

## 安裝xwPython

### 問題

當前使用的python環境為python 3.10.2[wxPython 4.1.1目前最高版本支持僅到Python 3.9](https://discuss.wxpython.org/t/wxpython-for-python-3-10-1-windows-64bit/35745),因此在安裝時會出現如下問題, 主要是:

note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

References: </br>

[1] https://discuss.wxpython.org/t/wxpython-for-python-3-10-1-windows-64bit/35745

[2] https://wxpython.org/Phoenix/snapshot-builds/

[3] https://extras.wxpython.org/wxPython4/extras/4.1.1/

```

>pip3 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 c:\customprogram\python310\lib\site-packages (from wxPython) (9.1.0)

Requirement already satisfied: six in c:\customprogram\python310\lib\site-packages (from wxPython) (1.16.0)

Requirement already satisfied: numpy in c:\customprogram\python310\lib\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:\CustomProgram\Python310\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:\CustomProgram\Python310\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\*****\AppData\Local\Temp\pip-install-orv4glt0\wxpython_dcdb3ca6e5ae4a3fb1044710386c6da5\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:\CustomProgram\Python310\python.exe"

? ? ? 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [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:\CustomProgram\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:\CustomProgram\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize

? ? ? ? ? vc_env = query_vcvarsall(VERSION, plat_spec)

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

? ? ? ? ? return EnvironmentInfo(arch, ver).return_env()

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

? ? ? ? ? [self.VCIncludes,

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

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

? ? ? ? File "C:\CustomProgram\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.293s)

? ? ? Finished command: build (0.293s)

? ? ? 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:\CustomProgram\Python310\python.exe" -u build.py build

? ? ? Command '"C:\CustomProgram\Python310\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:\CustomProgram\Python310\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:\CustomProgram\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\*****\AppData\Local\Temp\pip-install-orv4glt0\wxpython_dcdb3ca6e5ae4a3fb1044710386c6da5\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:\CustomProgram\Python310\python.exe"

? ? ? 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [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:\CustomProgram\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:\CustomProgram\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize

? ? ? ? ? vc_env = query_vcvarsall(VERSION, plat_spec)

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

? ? ? ? ? return EnvironmentInfo(arch, ver).return_env()

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

? ? ? ? ? [self.VCIncludes,

? ? ? ? File "C:\CustomProgram\Python310\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

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

? ? ? ? File "C:\CustomProgram\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.254s)

? ? ? Finished command: build (0.254s)

? ? ? 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:\CustomProgram\Python310\python.exe" -u build.py build

? ? ? Command '"C:\CustomProgram\Python310\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.

```

### 解決辦法:

1. 降級Python 3到python 3.9或更低

2. 安裝wxPython310

```

pip3 install wxpython310

```

總結

以上是生活随笔為你收集整理的【wxPython 安装指南:error: legacy-install-failure】的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。