# Install virtualenv using pip3
sudo pip3 install virtualenv
# Create virtualenv
virtualenv venv
virtualenv -p python3 venv # To create virtualenv with python3 for example
virtualenv -p /usr/bin/python2.7 # To create virtualenv with Python interpreter of your choice
# Activate virtualenv
source venv/bin/activate
# Desactivate venv
deactivate
#Creating virtual environment in Linux
$ sudo apt-get install python-pip
#Then install virtualenv
$ pip install virtualenv
#Now check your installation
$ virtualenv --version
#Create a virtual environment now,
$ virtualenv virtualenv_name
#After this command, a folder named virtualenv_name will be created. You can name anything to it. If you want to create a virtualenv for specific python version, type
$ virtualenv -p /usr/bin/python3 virtualenv_name
or
$ virtualenv -p /usr/bin/python2.7 virtualenv_name
#Now at last we just need to activate it, using command
$ source virtualenv_name/bin/activate
#Now you are in a Python virtual environment
#You can deactivate using
$ deactivate
virtualenv name
virtualenv name
$ virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute.........done.
Installing pip................done.
$ source venv/bin/activate
(venv)$ python