pip install -r requirements.txt出现错误解决办法

pip install -r requirements.txt安装出现以下错误解决办法如下:

 PS D:\YOLO\yolov5-master> pip install -r requirements.txt
 Collecting matplotlib>=3.2.2
  Downloading matplotlib-3.5.3-cp310-cp310-win_amd64.whl (7.2 MB)
 ━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/7.2 MB 10.2 kB/s eta 0:09:13
ERROR: Exception:
Traceback (most recent call last):
File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 435, in _error_catcher
yield
File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 516, in read
data = self._fp.read(amt) if not fp_closed else b""
...............
File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 440, 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 -r requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
  • 9
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值