使用pip 7.1.2和Python3.5完全无法安装任何包

Using pip 7.1.2 and Python 3.5 completely unable to install any packages

我有一个主要问题阻止我在虚拟环境中使用 pip 7.1.2Python 3.5 设置我的开发环境。首先,我什至无法更新 pip,更不用说安装 any 软件包了,因为这总是相同的错误:

(venv) ➜  venv git:(master) ✗ pip install --upgrade pip
Collecting pip
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

让我们尝试一个包含以下内容的 requirements.txt 文件:

pytz
django==1.11.4

产生的错误是一样的:

(venv) ➜  venv git:(master) ✗ pip install -r requirements.txt
Collecting pytz (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement pytz (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for pytz (from -r requirements.txt (line 1))

也许是因为缺少版本号?让我们添加最新的正确软件包版本 2019.2,然后 运行 从 requirements.txt 安装一次。

(venv) ➜  venv git:(master) ✗ pip install -r requirements.txt     
Collecting pytz==2019.2 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement pytz==2019.2 (from -r deploy/requirements.txt (line 1)) (from versions: )
No matching distribution found for pytz==2019.2 (from -r requirements.txt (line 1))

让我们试试 django,有或没有版本号。

(venv) ➜  venv git:(master) ✗ pip install django
Collecting django
Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

OSX 上版本 9.0.2 下的 pip 似乎与新 pip 服务器颁发的 SSL 证书不兼容。要在这种情况下手动升级 pip,您需要 运行 以下内容:

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