[pip]pip install wx报错ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+

(tf) C:\Users\ilixi>pip install wxpython
Collecting wxpython
  Using cached wxPython-4.2.1.tar.gz (73.7 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in d:\environment\anaconda3\envs\tf\lib\site-packages (from wxpython) (9.5.0)
Requirement already satisfied: six in d:\environment\anaconda3\envs\tf\lib\site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in d:\environment\anaconda3\envs\tf\lib\site-packages (from wxpython) (1.21.6)
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
  ╰─> [29 lines of output]
      running bdist_wheel
      running build
      Will build using: "D:\environment\anaconda3\envs\tf\python.exe"
      3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.1

      Running command: build
      Running command: build_wx
      CL.exe: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.exe
      Downloading microsoft.web.webview2 1.0.1185.39...
      Traceback (most recent call last):
        File "build.py", line 668, in getMSWebView2
          import requests
        File "D:\environment\anaconda3\envs\tf\lib\site-packages\requests\__init__.py", line 43, in <module>
          import urllib3
        File "D:\environment\anaconda3\envs\tf\lib\site-packages\urllib3\__init__.py", line 42, in <module>
          "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
      ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h  27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168
      Finished command: build_wx (0.408s)
      Finished command: build (0.408s)
      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:\environment\anaconda3\envs\tf\python.exe" -u build.py build
      Command '"D:\environment\anaconda3\envs\tf\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
ERROR: Could not build wheels for wxpython, which is required to install pyproject.toml-based projects

解决方法:由于错误源在urllib3 v2.0 only supports OpenSSL 1.1.1+,所以卸载掉urllib3 2.0+版本,安装1.21.1版本pip install urllib3==1.21.1即可继续安装。

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值