virtualenvwrapper
As of May 2022, virtualenvwrapper
is tested under Python 2.7-3.6
virtualenvwrapper
$ python3 -m pip install virtualenvwrapper
$ which virtualenvwrapper.sh
Additions to .bash_profile
export PATH="$HOME/.local/bin:$PATH"
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
export VIRTUALENVWRAPPER_PYTHON=$(which python)
export VIRTUALENVWRAPPER_VIRTUALENV=$(which virtualenv)
export WORKON_HOME="$HOME/virtualenvs"
export PROJECT_HOME="$HOME/Development"
source "/usr/local/bin/virtualenvwrapper.sh"
virtualenvwrapper
Will show virtual environments
$ workon
Can activate virtual environment by passing the env as an argument
$ workon my_env
Making new projects using virtualenvwrapper
$ mkproject new_project
Binding environment to project location
# activate environment
$ workon my_env
# move to correct folder
(my_env) $ cd ~/some/path/to/my_env
# bind environment to folder
(my_env) $ setvirtualenvproject
Can make temporary environment
$ mktmpenv
deactivating this environment with deactivate
will delete the environment and any packages installed for it