Setting up virtualenv for Python



Install virtualenv on Debian Wheezy

Install via pip:

pip install virtualenvwrapper

Add global variables to your shell startup file:

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/

Remember to reload your shell.

Creating a virtualenv

Here is a collection of creating commands that I have needed.

Standard create

mkvirtualenv name

Python3 create

mkvirtualenv -p /usr/bin/python3 name

Custom path

mkvirtualenv /path/to/env

Note: This will create the env where you want it, but you will not be able to use workon and lsvirtualenv to find it.