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就可以了, 下载速度巨快,

相关推荐
壹屋安源1 天前
CentOS 安装 Python 3.11.9完整流程
python·centos·virtualenv·pip·python3.11
huanglianggu2 天前
pip install django-ckeditor -i https://pypi.doubanio.com/simple/
django·sqlite·pip
伊玛目的门徒5 天前
容器内pip安装Apache Airflow的经历:如何重置初始密码
python·jupyter·pip·工作流·apache airflow
计算机学姐7 天前
基于Python的影院电影购票系统
开发语言·vue.js·后端·python·mysql·pycharm·pip
沙飞扬的时候8 天前
删除conda和 pip 缓存的包
pip
Bio Coder12 天前
`pip` 下载速度慢
国内源·pip·速度慢··更换
wendy58743613 天前
pip使用
pip
Rick is Geek14 天前
在Windows下通过pip安装Selenium
windows·selenium·pip
love_and_hope14 天前
Pytorch学习--神经网络--线性层及其他层
人工智能·pytorch·python·深度学习·神经网络·学习·pip
是丝豆呀14 天前
清理pip和conda缓存
缓存·conda·pip