Ubuntu - Python安装

时间:2015-02-09 04:18:00

标签: python ubuntu numpy matplotlib install

我的机器上安装了python-2.7.9,我正在尝试安装numpy,matplotlib,pyopengl和pyqt4。

我已经使用源文件安装了pyqt4,并且在使用python时导入正常,但是,我得到其余包的错误.... no module named numpy

我使用以下命令安装了numpy和matplotlib: sudo apt-get install python-numpy sudo apt-get install pyhton-matplotlib

我也试过使用pip和aptitude,但我仍然得到同样的错误..我不确定我做错了什么或如何解决这些问题。有没有人有任何建议?

更新:

使用Ubuntu 14.04.1 LTS

这些是我得到的错误: Python 2.7.9 (default, Feb 5 2015, 11:24:57) [GCC 4.8.2] on linux2 Type "help", "copyright", or "license" for more information.

import numpy Traceback (most recent call last): File "", line 1, in ImportError: Mo module named numpy

1 个答案:

答案 0 :(得分:0)

在ubuntu 14.04中,您想要的软件包不仅仅被称为numpymatplotlib。相反,他们是python-numpypython-matplotlib。因此,要安装它们,您需要:

sudo apt-get install python-numpy
sudo apt-get install python-matplotlib

编辑:

根据下面的评论,问题是与Ubuntu提供的版本不同的python 2.7版本。更多评论信息。 ubuntu的python的别名似乎解决了这个问题。