Install Virtualenv without sudo privilege
- Download and unzip one of the latest pacages:
1
2
| wget https://github.com/pypa/virtualenv/archive/15.1.0.tar.gz
tar -zxvf 15.1.0.tar.gz
|
- Run command below to create an environment:
1
2
| cd 15.1.0
python virtualenv.py ~/tfenv
|
- Activate the virtualenv environment using source command:
1
| source ~/tfenv/bin/activate
|
It will change you prompt to: (tfenv)$
- Install pip in your the environment:
1
| (tfenv)$ easy_install -U pip
|
- Install tensorflow using pip:
1
| (tfenv)$ pip install --upgrade tensorflow
|
Uninstallation
Enter & Quit the environment
1
| source ~/tfenv/bin/activate
|
Validate the installation
- Enter the following program, the system should output “Hello, TensorFlow!”:
1
2
3
4
| >>> import tensorflow as tf:
>>> hello = tf.constant("Hello, TensorFlow!")
>>> sess = tf.Session()
>>> print sess.run(hello)
|
If anything goes wrong, please comment below, I’ll response when I see it.
Have fun!