workon virtualenv code example
Example 1: how to use virtualenvwrapper
pip install virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv dev_env1
mkvirtualenv dev_env2
mkvirtualenv dev_env3
mkvirtualenv dev_env4
mkproject project1
mkproject -p python3 project2
mkproject project3
mkproject projectN
setvirtualenvproject
workon
workon dev_env1
rmvirtualenv dev_env4
mktempenv
deactivate
Example 2: virtualwrapper
$ pip install virtualenvwrapper
...
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
$ source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv env1
Installing
setuptools..........................................
....................................................
....................................................
...............................done.
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/predeactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/preactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postactivate New python executable in env1/bin/python
(env1)$ ls $WORKON_HOME
env1 hook.log
Example 3: show environment in virtualenvwrapper
lsvirtualenv