# Run the following command:

sudo apt-get install python-setuptools python-dev build-essential


# Install pip:

sudo apt-get install python-pip


# Install virtualenv:

pip install virtualenv


# Install virtualenvwrapper:

pip install virtualenvwrapper


# Open ~/.bashrc and add the following two lines:

export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh


# Save the bashrc file and run the following on your terminal:

source ~/.bashrc


# Now, you are ready to start using virtualenv:
# ----------------------------------------------

# Create a virtual environment called "new_virtual_env" by using the following command:

mkvirtualenv new_virtual_env


# Activate your new virtual environment by using:

workon new_virtual_env


# When your work is done, deactivate the virtual environment you are in by using:

deactivate new_virtual_env