python

安装python扩展 && 查看扩展
python install model_name #安装名为model_name的扩展
python -m pip list #查看已安装得扩展
安装opencv-python超时
错误信息

C:\Windows\system32>pip install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.5.62-cp36-abi3-win_amd64.whl (35.4 MB)
------------------ --------------------- 16.7/35.4 MB 19.1 kB/s eta 0:16:18
ERROR: Exception:
Traceback (most recent call last):
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py”, line 438, in _error_catcher
yield
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py”, line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py”, line 90, in read
data = self.__fp.read(amt)
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\http\client.py”, line 465, in read
s = self.fp.read(amt)
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\socket.py”, line 705, in readinto
return self._sock.recv_into(b)
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\ssl.py”, line 1273, in recv_into
return self.read(nbytes, buffer)
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\ssl.py”, line 1129, in read
return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out
During handling of the above exception, another exception occurred:

exit
self.gen.throw(typ, value, traceback)
File “C:\Users\wangx\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py”, line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, “Read timed out.”)
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.

超时解决方案
设置镜像地址
安装设置临时时间 pip install --default-timeout=1000 model_name

C:\Windows\system32>pip install --default-timeout=1000 opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.5.62-cp36-abi3-win_amd64.whl (35.4 MB)
---------------------------------------- 35.4/35.4 MB 78.2 kB/s eta 0:00:00
Requirement already satisfied: numpy>=1.14.5 in c:\users\wangx\appdata\local\programs\python\python310\lib\site-packages (from opencv-python) (1.22.2)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.5.62

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值