Skip to content

Instantly share code, notes, and snippets.

@caseywdunn
Created June 24, 2016 18:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caseywdunn/63c1932123f5d071489e5c4eecb2fe2d to your computer and use it in GitHub Desktop.
Save caseywdunn/63c1932123f5d071489e5c4eecb2fe2d to your computer and use it in GitHub Desktop.
Setup and examples of virtualenv on osx
# Setting up virtualenv on macOS Yosemite
brew update
brew upgrade
which python # check location of system version
brew install python
brew install freetype # Needed by some python packages
brew install libxml2 # Needed by some python packages
pip install virtualenv virtualenvwrapper pytest
# Added the following lines to ~/.bash_profile (without leading #)
# export PIP_REQUIRE_VIRTUALENV=true
# export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
# export WORKON_HOME='~/Dropbox/virtualenvs'
mkdir ~/Dropbox/virtualenvs
source ~/.bash_profile
source /usr/local/bin/virtualenvwrapper.sh
# For example, make and load the virtual environment biolite
mkvirtualenv biolite
git clone https://caseywdunn@bitbucket.org/caseywdunn/biolite.git
cd biolite
git checkout devel
pip install matplotlib # Not sure why, but works best to install matplotlib first
pip install -e .
# Deactivate the virtual environment
deactivate
# Work on it again
workon biolite
# Delete it
deactivate
rmvirtualenv biolite
# A Scinve virtualenv
mkvirtualenv science
pip install jupyter matplotlib numpy scipy pandas nltk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment