Skip to content

Isolated Python Environments

dongsheng edited this page Oct 16, 2012 · 1 revision

Install virtualenv and virtualenvwrapper

virtualenv is a python package to create virtualenv to build virtual python environment, virtualenvwrapper is a set of bash function to make using virtualenv easier.

pacman -S python2-virtualenv
pacman -S python2-virtualenvwrapper

Adding variables to your shell profile

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=`which python2`
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv2
source /usr/bin/virtualenvwrapper.sh

Create virtual python environment

Run:

workon

will give you a list of created virtual environments, if followed by environment name, will switch to that virtual environment

mkvirtualenv

will create new virtual environment

rmvirtualenv

Remove virtual environment