Ubuntu16.04下为python3安装numpy,scipy等依赖

Ubuntu系统中自带的pyhton版本为2.7,要使用python3则要自己安装,两个版本的python可以共存。安装成功后,分别用python和python3进入。要调用一些包则要分别安装。

  1. python2.7安装numpy等依赖
    sudo apt-get install python-nose
    sudo apt-get install python-scipy
    sudo apt-get install python-numpy
  2. python3安装numpy等依赖
    sudo apt-get install python3-nose
    sudo apt-get install python3-scipy
    sudo apt-get install python3-numpy

安装完毕后在python和python3的命令行界面中import numpy和import scipy测试。
查看所有python的版本和位置可以使用两种命令:
whereis python 和 ls -l /usr/bin/python*
查看默认python的版本的命令:
python -V

你可能感兴趣的:(Ubuntu16.04下为python3安装numpy,scipy等依赖)