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

相关推荐
九河_20 小时前
解决pip install gym==0.19.0安装失败问题
开发语言·python·pip·gym
小oo呆1 天前
【学习心得】conda打包进行环境迁移遇到conda包和pip包管理冲突问题
conda·pip
万粉变现经纪人10 天前
如何解决 pip install 安装报错 [WinError 32] 文件被占用(杀毒/占用进程)问题
python·pycharm·flask·beautifulsoup·bug·pandas·pip
PKNLP10 天前
11.大模型Agent应用
python·agent·pip
jiayi_199914 天前
Linux 容器安装 conda 和 pip
linux·conda·pip
Jc.MJ19 天前
安装Pytorch GPU+CPU版本【通过本地安装解决无法使用pip指令下载问题】
人工智能·pytorch·pip
想名字好难啊竟然不止我一个20 天前
清除 Pip 缓存, 释放磁盘空间
python·缓存·pip
懒惰蜗牛23 天前
Day10:Python实现Excel自动汇总
python·numpy·pandas·pip·1024程序员节·python读写excel
蓝纹绿茶24 天前
bash:**:pip:***python: 错误的解释器: 没有那个文件或目录
开发语言·python·pip
Nie_Xun1 个月前
conda常用命令&pip、venv
conda·pip