Skip to content

Instantly share code, notes, and snippets.

@preetampvp
Last active March 22, 2017 09:15
Show Gist options
  • Select an option

  • Save preetampvp/c4f2cc5143fb6fae6a0556d261db3fdc to your computer and use it in GitHub Desktop.

Select an option

Save preetampvp/c4f2cc5143fb6fae6a0556d261db3fdc to your computer and use it in GitHub Desktop.
setting up virtualenv

sudo pip install virtualenv

mkdir ~/.virtualenvs && cd $_

Creating a new project

virtualenv theproject . theproject/bin/activate

install packages now using pip (the prompt should show the active project name)

deactivate - to exit project

Virtualenvwrapper

sudo pip install virtualenvwrapper

edit ~/.zshrc

source /usr/local/bin/virtualenvwrapper.sh
export PROJECT_HOME=$HOME/dev

Commands

mkvirtualenv <name> - in the project dir will create a virtual env for the project

setvirtualenvproject - when project is active .. will bind the project to virtual env

workon - lists all the projects

workon <project name> - activates project

deactivate - to unload project

mkproject <name> - creates project folder, creates virtual env, moves into project folder and activates project

mktmpenv - creates a temp env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment