我正在运行python 3.5.2并想运行
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
但是,如果我登记终端
ola@station:~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python2.7/dist-packages
ola@station:~$
为什么我有这么多不同的点?
ola@station:~$ pip
pip pip2 pip2.7 pip3 pip3.4 pip3.5 pip3.6
当我尝试使用pip3.4时,我得到了
ola@station:~$ pip3.5 install numpy
Traceback (most recent call last):
File "/usr/local/bin/pip3.5", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2991, in <module>
@_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2977, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 664, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 677, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 856, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==8.1.2' distribution was not found and is required by the application
答案 0 :(得分:5)
每个版本的python都有一个点子。 如果你想为python3.5安装numpy,你可以使用:
pip3.5 install numpy