Python 3 On Linux Amazon EC2 - Part 3
![]()
In this post we are going to look at using virtualenvwrapper in conjunction with virtualenv.
First, install it
sudo `which pip` install virtualenvwrapperand add the line
source /usr/local/bin/virtualenvwrapper.shto .bash_profile.
Restart the shell
exec bash -lOne of the benefits of using virtualenvwrapper is that it makes it easier to create virtual environments. From
virtualenvwrapper --helpwe have
mkvirtualenv: Create a new virtualenv in $WORKON_HOMENext,
$WORKON_HOME needs to be set in .bash_profile, e.g. by adding
export WORKON_HOME=~/.virtualenvsTo test, the most common commands are
workonwhich returns a list of all virtual environments, as does
lsvirtualenvOther common commands are
mkvirtualenv venv1
deactivate
rmvirtualenv venv1(when a new virtual environment is created, it is automatically activated, and an environment cannot be deleted whilst activated).