Virtualenv and Virtualenvwrapper

Virtualenv

It is a tool used to create isolated Python environment.

Why create isolated Python environment?

To work on different projects with different requirements.

Virtualenvwrapper

Virtualenvwrapper is just a simple wrapper around virtualenv which makes it easier to work with it.

LiNUX COMMANDS TO INSTALL virtualenv and virtualenvwrapper AND CREATE VIRTUAL ENVIRONMENT:

1. $ su –

(become root first)

2. $pip install virtualenv

(make sure you have pip already installed)

3. $pip install virtualenvwrapper

3. $export WORKON_HOME=~/Envs

4. $mkdir -p $WORKON_HOME

5. $source virtualenvwrapper.sh

(exact path to virtualenvwrapper.sh)

6. $mkvirtuaenv env1

(you can put anyname in place of “env1”)

7. $deactivate

(to get out of the virtual environment)

8. $rmvirtualenv env1

(to delete virtual environment)

Virtualenv and Virtualenvwrapper