pip+代理

在cmd中使用代理时执行pip指令下载包时, 会报错

复制代码
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/opencv-python/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/opencv-python/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/opencv-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/opencv-python/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))) - skipping
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /whl/cu118/opencv-python/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /whl/cu118/opencv-python/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /whl/cu118/opencv-python/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /whl/cu118/opencv-python/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /whl/cu118/opencv-python/
Could not fetch URL https://download.pytorch.org/whl/cu118/opencv-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='download.pytorch.org', port=443): Max retries exceeded with url: /whl/cu118/opencv-python/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))) - skipping
ERROR: Could not find a version that satisfies the requirement opencv-python==4.8.1.78 (from versions: none)
ERROR: No matching distribution found for opencv-python==4.8.1.78

为一堆WARNING+SSLERROR

不用代理的话下载速度巨慢, 就几十kb

解决方法

导航到文件

复制代码
%USERPROFILE%\pip\pip.ini

加入代理地址, 端口

之后正常pip就可以了, 下载速度巨快,

相关推荐
Tipriest_19 小时前
详细解释pip及其使用方法(对比apt)
大数据·elasticsearch·apt·pip
勇往直前plus2 天前
PyCharm 找不到包?Anaconda base 环境 pip 装到用户目录的排查与修复
ide·python·pycharm·conda·pip
yuezhilangniao3 天前
Windows 系统变量未完全清楚 - 代理执行一半 导致 pip 和 Postman 连接失败的解决指南
windows·postman·pip
Better Bench4 天前
ubuntu 不同系统架构(aarch64\arm64\x86_64)安装miniconda以及配置pip镜像
linux·ubuntu·pip
这个人懒得名字都没写4 天前
Python包管理新纪元:uv
python·conda·pip·uv
徐先生 @_@|||5 天前
pip多源设置
pip
胡八一5 天前
解决使用PCbuild\build.bat构建python之后,运行pip报错
开发语言·python·pip
万粉变现经纪人6 天前
如何解决 pip install 网络报错 403 Forbidden(访问被阻止)问题
数据库·python·pycharm·beautifulsoup·bug·pandas·pip
狐狸1178 天前
解决在win10找不到site-packages\torch\lib\shm.dll“ or one of its dependencies 问题
pytorch·conda·pip
封奚泽优8 天前
Deep-Live-Cam(调试和求助)
git·python·ffmpeg·pip·cuda