Saturday, January 20, 2018

Working in or using Python virtualenv

Install Python virtualenv on Ubuntu using below command
apt-get -y install python-virtualenv

Create virtualenv
$virtualenv test_env1
New python executable in test_env1/bin/python

$. test_env1/bin/activate
Or
$source test_env1/bin/activate

Exit virtualenv
$deactivate

Switch between virtualenv’s
$workon test_env2

List all available virtualenv’s
$workon


virtualenvwrapper comes with few handy commands

$pip install virtualenvwrapper

virtualenvwrapper supports extra commands like
mkvirtualenv
cdvirtualenv
rmvirtualenv