Skip to content

virtualenvwrapper

virtualenvwrapper

Usage

Create a virtualenv

mkvirtualenv --python `which python2` 

Switch between virtualenvs

workon

Install

export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh

(https://virtualenvwrapper.readthedocs.io/en/latest/)

Config

Setup enviroment variables in a virtualenv

Edit $VIRTUAL_ENV/bin/postactivate and there add:

export VAR=value

(https://stackoverflow.com/questions/9554087/setting-an-environment-variable-in-virtualenv)