python3通过pip3安装第三方库-numpy、matplotlib、scipy、tensorflow等

pip是python的第三方软件管理工具,通过pip我们很方便地安装第三方软件包。

pip2是python2.x对应的第三方软件管理工具

pip3是python3.x对应的第三方软件管理工具

pip安装

python3安装pip

sudo apt install python3-pip

python2安装pip

sudo apt install python2-pip

通过pip安装第三方库:

安装numpy, scipy, sklearn, matplotlib等

python2安装方式:

pip2 install numpy
pip2 install matplotlib
pip2 install scipy
pip2 install sklearn 

python3安装方式

pip3 install numpy
pip3 install matplotlib
pip3 install scipy
pip3 install sklearn

安装TensorFlow

$ pip install tensorflow      # Python 2.7; CPU support
$ pip3 install tensorflow     # Python 3.n; CPU support

如果上面的安装出错,可以通过以下命令安装最新的TensorFlow:

$ sudo pip  install --upgrade tfBinaryURL   # Python 2.7
$ sudo pip3 install --upgrade tfBinaryURL   # Python 3.n 

上面以安装TensorFlow 1.3.0为例,若输入的是pip,则为python2安装TensorFlow 1.3.0

更新TensorFlow

(tensorflow)$ pip install --upgrade tensorflow      # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow     # for Python 3.n


博文转自:http://blog.csdn.net/eloque/article/details/78227620