Setting up virtualenv for Python

Modified:
Created:

[TOC]

Install virtualenv on Debian Wheezy

Install via pip:

pip install virtualenvwrapper

Add global variables to your shell startup file:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

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.