简体   繁体   English

如何为新的python版本安装numpy

[英]how to install numpy for newer python version

I'm running python 3.5.2 and would like to run 我正在运行python 3.5.2,并且想运行

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'

however if I check in a terminal 但是如果我在码头登机

ola@station:~$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python2.7/dist-packages
ola@station:~$ 

Why do I have so many different pip's? 为什么我有这么多不同的点子?

ola@station:~$ pip
pip     pip2    pip2.7  pip3    pip3.4  pip3.5  pip3.6  

and when I try to use pip3.4 I get 当我尝试使用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

You have one pip for each version of python. 每个python版本都有一个点。 If you want to install numpy for python3.5, you can use : 如果要为python3.5安装numpy,可以使用:

pip3.5 install numpy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 python 软件包从旧版本安装到新版本? - How to install python packages from older version to newer version? 如何在正确的python版本中安装numpy和matplotlib? - How to install numpy and matplotlib in the right python version? 如何在 python 2.7.9 版本中安装 numpy 和 pandas - how to install numpy and pandas in python 2.7.9 version 在Ubuntu上,如何安装较新版本的python并保留较旧的python版本? - On Ubuntu, how do you install a newer version of python and keep the older python version? 如何在venv中安装较新的python3版本而不进行系统范围的安装? - How to install newer python3 version in venv without a system wide install? 安装较新版本后如何安装较旧版本的python - How to install older version of python when we have installed a newer version Python 安装错误“已安装较新版本的 Python 启动器” - Python install error "A newer version of the Python launcher is already installed" 在 AWS Lambda 上安装更新版本的 sqlite3 以与 Python 一起使用 - Install newer version of sqlite3 on AWS Lambda for use with Python 如何让pip指向更新版本的Python - How to get pip to point to newer version of Python 如果发生冲突,如何在 conda 中安装较新版本的 package? - How to install newer version of package in conda in case of conflicts?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM