如何在ubuntu上安装python ML的软件包?

时间:2018-02-11 07:03:28

标签: python numpy ubuntu matplotlib installation

我在尝试在Ubuntu上安装以下软件包时遇到问题:

  • SciPy的
  • numpy的
  • matplotlib
  • 熊猫
  • sklearn

执行命令时:
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

我收到以下消息:
Reading package lists... Done Building dependency tree
Reading state information... Done build-essential is already the newest version (12.1ubuntu2). You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies. libatlas-dev : Depends: libblas-dev but it is not going to be installed libatlas3-base : Depends: libgfortran3 (>= 4.6) but it is not going to be installed Depends: libblas-common but it is not going to be installed python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed python-scipy : Depends: python-decorator but it is not going to be installed Depends: libgfortran3 (>= 4.6) but it is not going to be installed Recommends: python-imaging but it is not going to be installed python-setuptools : Depends: python-pkg-resources (= 20.7.0-1) but it is not going to be installed rstudio : Depends: libjpeg62 but it is not going to be installed Depends: libgstreamer0.10-0 but it is not going to be installed Depends: libgstreamer-plugins-base0.10-0 but it is not going to be installed Recommends: r-base (>= 2.11.1) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


所以这些软件包无法安装,但我真的需要这些软件包来开始一个新项目,我怎样才能成功安装这些软件包呢?

3 个答案:

答案 0 :(得分:1)

运行' sudo apt-get -f install'正如它所暗示的那样。

您的apt存储库似乎已损坏。该命令将修复它。 (-f用于修复损坏)请参阅http://manpages.ubuntu.com/manpages/xenial/man8/apt-get.8.html

(p.s。:我删除了我之前的答案并决定开始一个干净的答案。)

答案 1 :(得分:0)

你无法使用apt-get安装它。你需要先安装pip。安装pip后,只需谷歌了解如何使用pip

安装不同的软件包

答案 2 :(得分:0)

试试这个: -

sudo apt-get install python-pip

要验证下载是否成功,请尝试以下命令。

pip -V

你应该得到这样的东西: -

#pip -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

之后运行以下命令: -

sudo pip install numpy scipy pandas sklearn matplotlib

这样就可以了。