mac下python环境pip报错[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) 的解决方法

1.mac下python环境pip报错:python

issuserdeMacBook-Pro:~ issuser$ pip install pyinstaller
Collecting pyinstaller
  Could not fetch URL https://pypi.python.org/simple/pyinstaller/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement pyinstaller (from versions: )
No matching distribution found for pyinstaller

linux

2.出现这个错误的缘由是python.org已经不支持TLSv1.0和TLSv1.1了更新pip能够解决这个问题。bootstrap

可是若是使用传统的python -m pip install --upgrade pip的方式,仍是会出现那个问题。这是由于TLS证书的问题须要去升级pip,升pip的时候又由于TLS证书的缘由不能下载最新版本的pip。这时候就没有办法了,只能手动的去升级pip。windows

3.解决方式以下:
mac或者linux操做系统:在终端下执行命令:curl https://bootstrap.pypa.io/get-pip.py | python。
windows操做系统:从https://bootstrap.pypa.io/get-pip.py下载get-pip.py文件,而后使用python运行这个文件python get-pip.py便可。

curl

相关文章
相关标签/搜索