Virtualenv with Virtualenvwrapper Debian

Virtualenv is usefull to create isolated environments for Python projects.

Install pip

[/crayon]

Install virtualenv

[/crayon]

Create a dir to store your virtualenvs

[/crayon]

At this point you are all set to use virtualenv with the standard commands. However, I prefer to use the extra commands included in virtualenvwrapper. Lets set that up.

Install virtualenvwrapper

[/crayon]

Set WORKON_HOME to your virtualenv dir

[/crayon]

Add virtualenvwrapper.sh to .bashrc

[/crayon]

Exit and re-open your shell, or reload .bashrc with the command . .bashrc and you’re ready to go.

Create a new virtualenv

[/crayon]

to exit your new virtualenv, use deactivate.

Switch between enviornments with workon

To load or switch between virtualenvs, use the workon command:

[/crayon]

You can read more about virtualenv here and virtualenvwrapper here. You might also want to look at this very similar (and probably better) python guide post.

Source

http://roundhere.net/journal/virtualenv-ubuntu-12-10/