(recomended if have multiple apps running on different enviroments)
$ pip install virtualenv virtualenvwrapper
$ mkdir ~/.virtualenvs
$ export WORKON_HOME=~/.virtualenvs
Add this line to the end of ~/.bashrc so that the virtualenvwrapper commands are loaded.
. /usr/local/bin/virtualenvwrapper.sh
Exit and re-open your shell, or reload .bashrc
with the command
source ~/.bashrc
Virtualenvwrapper is a utility on top of virtualenv
that adds a bunch of utilities
that allow the environment folders to be created at a single place,
instead of spreading around everywhere.
Create a virtual envirioment to work under:
$ mkvirtualenv codebench
See Virtualenvwrapper on Ubuntu for more details.
lsvirtualenv
mkvirtualenv [mkvirtualenv-options] [virtualenv-options] <name>
[mkvirtualenv-options]
-h Print help text.
workon [<name>]
deactivate
rmvirtualenv <name>
$ mkvirtualenv --python=/usr/bin/python3 <env name>
https://github.com/davidmarble/virtualenvwrapper-win
pip install virtualenvwrapper-win
At this stage virtualenvwrapper
commands should work in cmd
, but not in git bash
.
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
Now it should work in both, but the default environment lists
are stored in different files,
so lsvirtualenv
would show different results.