安装tensorflow之virtualenv
在安装之前首先保证ubuntu、python,以及一些相应的包安装成功。
1.安装virtualenv
#(1) pip
$ sudo apt-get install python-virtualenv
#(2) pip3
$ sudo apt-get install python3-virtualenv
2.在virtualenv中创建tensorflow环境(以tensorflow为例)
$ virtualenv --system-sit-packages ~/tensorflow
3.激活tensorflow的virtualenv环境
$ source ~/tensorflow/bin/activate
#(1) pip
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
#(2) pip3
(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
4.测试tensorflow
$ python2.7
>>> import tensorflow
5.退出virtualenv
(tensorflow)$deactivate