1. Installation
sudo apt-get install python-virtualenv
2. Use
To create a virtual environment:
virtualenv [Virtual Environment name]
Example: Virtualenv python27
To activate using a virtual environment:
SOURCE ~/workplace/python27/bin/activate
Installation Library:
Example: Pip Install NumPy
Some libraries such as TensorFlow may have an error when installing: Could not find any downloads that satisfy the requirement TensorFlow, which is generally due to the PIP version being too low, Look at the PIP version number:
Pip--version
Then update the PIP:
Pip Install-u pip
Then re-pip to install the TensorFlow on it.
Use the following command to see which packages are installed in your current environment:
Pip Freeze
Exit the virtual Environment:
Deactivate
To delete a virtual environment:
rmvirtualenv [Virtual Environment name]
Linux configuration and use of virtual environments virtualenv