如何安装pip3 3.5版?

时间:2017-01-20 18:13:41

标签: python pip

我已经在Ubuntu 14.04上看到了安装了pip3.5的版本,但我不确定它是如何安装的,因为似乎没有pip3.5可用。

我试过了:

pip3 install --upgrade pip3==3.5
Collecting pip==3.5
  Could not find a version that satisfies the requirement pip==3.5 (from versions: 0.2, 0.2.1, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.2, 1.2.1, 1.3, 1.3.1, 1.4, 1.4.1, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.1.0, 6.1.1, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.1.2, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.1.0, 8.1.1, 8.1.2, 9.0.0, 9.0.1)
No matching distribution found for pip==3.5

如何安装pip版本3.5?

更新:

我通过以下方式安装了numpy

pip3 install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/lib/python3.4/dist-packages

尝试在python3.5中使用numpy会导致错误:

/usr/local/bin/python3.5
Python 3.5.0 (default, Jan 20 2017, 10:14:23)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import numpy as np
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'

但是安装了numpy:

pip3 install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/lib/python3.4/dist-packages

我错误地认为要修复我应该更新到pip版本3.5以匹配python版本3.5。

现在问题是如何将numpy安装到python版本3.5?

1 个答案:

答案 0 :(得分:3)

从此处https://pip.pypa.io/en/latest/installing/

下载get-pip.py

然后使用您选择的python解释器:

python3.5 get-pip.py --user

然后,通过使用带有-m开关的pip,您可以确定使用的解释器。

python3.5 -m pip install --user numpy

编辑:我有一个Ubuntu 14.04桌面正在运行并遇到同样的问题,没有找到点子。