【问题标题】:Install Numpy in Python 3.4.4 and Linux [duplicate]在 Python 3.4.4 和 Linux 中安装 Numpy [重复]
【发布时间】:2016-06-21 00:48:00
【问题描述】:

我刚刚安装了 Ubuntu 16.04,其中包括 Python 2.7.11 和 3.5.1。

我也成功安装了 Python 3.4.4。但是当我尝试安装numpy 时:

sudo apt-get install python-numpy 
sudo apt-get install python3-numpy 

它适用于 Python 2.7.11 和 3.5.1,但我需要它用于 Python 3.4.4。如何安装?

【问题讨论】:

  • 为什么不用pip?
  • python 2.7 中的 pip 安装和 3.51 中的 pip3...如何在 3.4.4 中安装?
  • 为什么是python 3.4.4 而不是python 3.5.1?有什么大的不同吗?
  • 不是为了python,而是为了开发一些优化模型的库。我从事运筹学工作,不幸的是,IBM CPLEX API 与 python 3.5 不兼容。

标签: python ubuntu numpy


【解决方案1】:

来自python docs:使用并行安装的多个 Python 版本时,可以使用以下命令与pip 一起为特定版本的 Python 安装 Python 包:

python2   -m pip install SomePackage  # default Python 2
python2.7 -m pip install SomePackage  # specifically Python 2.7
python3   -m pip install SomePackage  # default Python 3
python3.4 -m pip install SomePackage  # specifically Python 3.4
python3.5 -m pip install SomePackage  # specifically Python 3.5

因此,要为 Python3.4 安装 numpy 包,您可以使用以下命令:

~/$ python3.4 -m pip install numpy

【讨论】:

猜你喜欢
  • 2017-10-23
  • 2015-07-12
  • 1970-01-01
  • 1970-01-01
  • 2016-08-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-18
相关资源
最近更新 更多