为什么pip安装对我来说持续失败?

时间:2018-09-02 06:39:38

标签: python macos openssl pip

我在Macbook上。而且每当我尝试使用pip安装任何东西时,由于openssl问题而导致安装失败。以下正是我要尝试执行的步骤。

$ virtualenv --version
15.1.0

$ virtualenv saqibvenv7
New python executable in /Users/saqib.ali/saqibvenv7/bin/python
Installing setuptools, pip, wheel...done.

$ source saqibvenv7/bin/activate

(saqibvenv7) $ python --version
Python 2.7.10

(saqibvenv7) $ pip --version
pip 9.0.1 from /Users/saqib.ali/saqibvenv7/lib/python2.7/site-packages (python 2.7)

(saqibvenv7) $ pip install Django==1.8.2
Collecting Django==1.8.2
  Could not fetch URL https://pypi.python.org/simple/django/: 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 Django==1.8.2 (from versions: )
No matching distribution found for Django==1.8.2

对此有什么解决方案?我做过brew重新安装openssl。但这没什么区别。

1 个答案:

答案 0 :(得分:0)

尝试使用例如,安装pip的最新版本。 pip install --upgrade pip