![](https://csdnimg.cn/release/download_crawler_static/9464289/bg11.jpg)
1.2 DOWNLOAD AND SETUP ||
下载与安装 17
1 # Mac OS X
2 $ sudo easy_install pip
3 $ sudo pip install −−upgrade virtualenv
etcCreate a Virtualenv environment in the directory ~/tensorflow:
在~/tensorflow路径下建立一个 Virtualenv 环境:
1 $ virtualenv −−system−site−packages ~/tensorflow
Activate the environment and use pip to install TensorFlow inside it:
激活 Virtualenv 环境并使用 pip 在该环境下安装 TensorFlow:
1 $ source ~/tensorflow/bin/activate # If using bash
2 $ source ~/tensorflow/bin/activate.csh # If using csh
3 (tensorflow)$ # Your prompt should change
4
5 # Ubuntu/Linux 64−bit, CPU only:
6 (tensorflow)$ pip install −−upgrade https://storage.googleapis.com/
tensorflow/linux/cpu/tensorflow−0.5.0−cp27−none−linux_x86_64.whl
7
8 # Ubuntu/Linux 64−bit, GPU enabled:
9 (tensorflow)$ pip install −−upgrade https://storage.googleapis.com/
tensorflow/linux/gpu/tensorflow−0.5.0−cp27−none−linux_x86_64.whl
10
11 # Mac OS X, CPU only:
12 (tensorflow)$ pip install −−upgrade https://storage.googleapis.com/
tensorflow/mac/tensorflow−0.5.0−py2−none−any.whl
and again for python3:
1 $ source ~/tensorflow/bin/activate # If using bash
2 $ source ~/tensorflow/bin/activate.csh # If using csh
3 (tensorflow)$ # Your prompt should change
4
5 # Ubuntu/Linux 64−bit, CPU only:
6 (tensorflow)$ pip install −−upgrade https://storage.googleapis.com/
tensorflow/linux/cpu/tensorflow−0.6.0−cp34−none−linux_x86_64.whl
7
8 # Ubuntu/Linux 64−bit, GPU enabled:
9 (tensorflow)$ pip install −−upgrade https://storage.googleapis.com/
tensorflow/linux/gpu/tensorflow−0.6.0−cp34−none−linux_x86_64.whl
10
11 # Mac OS X, CPU only:
12 (tensorflow)$ pip3 install −−upgrade https://storage.googleapis.com/
tensorflow/mac/tensorflow−0.6.0−py3−none−any.whl
With the Virtualenv environment activated, you can now test your i nstallation.
在 Virtualenv 环境被激活时,您可以测试安装.
When you are done using TensorFlow, deactivate the environment.
当您无需使用 TensorFlow 时,取消激活该环境.
1 (tensorflow)$ deactivate
2 $ # Your prompt should change back
To use TensorFlow later you will have to activate the Virtualenv environment again:
如果需要再次使用 TensorFlow 您需要先再次激活 Virtualenv 环境:
1 $ source ~/tensorflow/bin/activate # If using bash.