happysundar
8/8/2013 - 2:27 AM

useful virtualenv/virtualenvwrapper commands

useful virtualenv/virtualenvwrapper commands

create a virtual env

 mkvirtualenv <venv_name>

change into the virtual env root dir

 cdvirtualenv <venv_name>

Switch into a virtual env

 workon <venv_name>

Change into the project directory, and then run..

This will change into the project directory while you select the working virtual environment (do a workon)

 setvirtualenvproject 

Use https://github.com/saghul/pythonz to install different versions of python

To install virtualenv, virtualenvwrapper et all natively (i.e, on the python "system" path of the machine), do a :

curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | $SHELL
mkvirtualenv -p ~/.pythonz/pythons/CPython-2.7.5/bin/python ~/VEnvs/MyProject
mkvirtualenv -p ~/.pythonz/pythons/CPython-2.7.5/bin/python -a ~/Rovi -r ./requirements.txt rovi