Skip to content

Instantly share code, notes, and snippets.

@dualcnhq
Last active January 26, 2016 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dualcnhq/8e17bae7ebd83da3378c to your computer and use it in GitHub Desktop.
Save dualcnhq/8e17bae7ebd83da3378c to your computer and use it in GitHub Desktop.
Python environment setup for MacOSX

Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then run the following command to ensure that there aren’t any potential problems with your environment. Some warnings (if any) are informational and not necessary actionable; it’s just a good idea to at least read through and see if anything looks out of the ordinary.

brew doctor

The following command will update to the latest version of Homebrew and its formulae:

brew update

Setup VirtualEnvs

$ pip install virtualenv
$ pip install virtualenvwrapper

Next, create a folder that will contain all your virtual environments:

$ mkdir ~/.virtualenvs

Open your .bashrc file and add:

export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

you can activate these changes by typing

$ source .bashrc

you are now ready to create a virtual enviroment

$ mkvirtualenv venv # can be any name

Work on a virtual environment

$ workon venv

Deactivating is still the same

$ deactivate

To delete:

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