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

相关推荐
WangY_ZQ3 天前
Python 如何在Python 3.6上安装PIP
linux·python·pip
猫头虎9 天前
零基础安装 Python 教程:从下载到环境配置一步到位(支持 VSCode 和 PyCharm)与常用操作系统操作指南
vscode·python·pycharm·beautifulsoup·numpy·pyqt·pip
代码讲故事13 天前
解决 xmlsec.InternalError: (-1, ‘lxml & xmlsec libxml2 library version mismatch‘)
linux·python·pip·lxml·xmlsec·libxml2
猫头虎18 天前
PyTorch入门教程:下载、安装、配置、参数简介、DataLoader(数据迭代器)参数解析与用法合集
人工智能·pytorch·python·深度学习·机器学习·pandas·pip
于归pro22 天前
Python环境管理工具深度指南:pip、Poetry、uv、Conda
python·pip·uv
水花花花花花24 天前
GloVe 模型讲解与实战
python·深度学习·conda·pip
正在走向自律1 个月前
Conda 完全指南:从环境管理到工具集成
开发语言·python·conda·numpy·fastapi·pip·开发工具
小猪写代码1 个月前
在 Ubuntu 20.04.6 LTS 中将 SCons 从 3.1.2 升级到 4.9.1
chrome·ubuntu·pip
tyn1881 个月前
记录一次conda虚拟环境pip安装报错[WinError 32] 另一个程序正在使用此文件,进程无法访问
windows·conda·pip·虚拟环境·虚环境
量化金策1 个月前
枢轴支压点策略
pip·ipython