Skip to content

Instantly share code, notes, and snippets.

@duyvk
Last active December 27, 2015 06:49
Show Gist options
  • Save duyvk/7284426 to your computer and use it in GitHub Desktop.
Save duyvk/7284426 to your computer and use it in GitHub Desktop.
Virtualenv installation
# see available virtualenvs
workon
# use a specific virtualenv (called "mrcoles")
workon mrcoles
# create a new virtualenv (called "mrcoles" that will reside
# in ~/.virtualenvs/mrcoles)
# optional: the -a `pwd` makes it always cd into your current dir
# optional: the -r requirements.txt will pip install requirements
mkvirtualenv mrcoles -a `pwd` -r requirements.txt
# disable your current virtualenv
deactivate
alias v='workon'
alias v.deactivate='deactivate'
alias v.mk='mkvirtualenv'
alias v.rm='rmvirtualenv'
alias v.switch='workon'
alias v.add2virtualenv='add2virtualenv'
alias v.cdsitepackages='cdsitepackages'
alias v.cd='cdvirtualenv'
alias v.lssitepackages='lssitepackages'
http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html
Installation
pip install virtualenv
pip install virtualenvwrapper
Configuration
--put in ~/.bashrc hoac ~/.bashprofile
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
-mkvirtualenv - used to create a new virtual environment. When you create a new environment it automatically becomes the active environment.
-rmvirtualenv - used to remove an existing virtual environment. The environment must be deactivated (see below) before it can be removed.
-workon - used to activate a virtual environment. Will also list all existing virtual environments if no argument is passed.
-deactivate - used to deactivate the currently active virtual environment. Note that workon will automatically deactivate the current environment before activating a new one.
>> mkvirtualenv marketplace-tests
>> pip install -Ur requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment