Skip to main content
 首页 » 编程设计

python之我无法升级 pip : Could not fetch URL https://pypi. python.org/simple/pip/: 确认 ssl 证书时出现问题

2025年05月04日23mfryf

尝试在我的终端中升级 pip。这是我的代码:

(env) macbook-pro83:zappatest zorgan$ pip install --upgrade pip 
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping 
Requirement already up-to-date: pip in ./env/lib/python3.5/site-packages 
You are using pip version 8.1.2, however version 10.0.1 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 

知道问题出在哪里吗?当我执行 pip install django 时,我也遇到同样的错误 There was a problem confirming the ssl certificate。

编辑 pip install --upgrade pip -vvv 返回:

1 location(s) to search for versions of pip: 
* https://pypi.python.org/simple/pip/ 
Getting page https://pypi.python.org/simple/pip/ 
Looking up "https://pypi.python.org/simple/pip/" in the cache 
Returning cached "301 Moved Permanently" response (ignoring date and etag information) 
Looking up "https://pypi.org/simple/pip/" in the cache 
Current age based on date: 23811 
Freshness lifetime from max-age: 600 
Freshness lifetime from request max-age: 600 
Starting new HTTPS connection (1): pypi.org 
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping 
Installed version (8.1.2) is most up-to-date (past versions: none) 
Requirement already up-to-date: pip in ./env/lib/python3.5/site-packages 
Cleaning up... 
You are using pip version 8.1.2, however version 10.0.1 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 

请您参考如下方法:

设法通过以下命令修复它(卸载并重新安装 pip):

curl https://bootstrap.pypa.io/get-pip.py | python