virtualenvwrapper windows code example

Example 1: 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 2: virtualenvwrapper-win

# For linux
sudo pip install virtualenvwrapper

# For windows
pip install virtualenvwrapper
pip install --user virtualenvwrapper

# Create virtual environment
virtualenvwrapper <env>
workon env

Run: workon
A list of environments, empty, is printed.

Run: mkvirtualenv temp
A new environment, temp is created and activated.

Run: workon
This time, the temp environment is included.

Run: workon temp
To activate temp env

Tags:

Misc Example