1$ pip install virtualenv
2$ pip install virtualenvwrapper
3
4// Append ~/.bashrc
5export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
6export WORKON_HOME=$HOME/.virtualenvs
7export VIRTUALENVWRAPPER_VIRTUALENV=/$HOME/.local/bin/virtualenv
8source ~/.local/bin/virtualenvwrapper.sh
1python3 -m venv name_environment #this creates the virtual environment
2
3source name_environment/bin/activate #this activates the virtual environment
4
5#to install packages first activate the environment then do pip install ...
1sudo apt-get install python3-pip
2virtualenv djangoProject
3virtualenv -p /usr/bin/python3.6 djangoProject
4source djangoProject/bin/activate