Skip to content

Instantly share code, notes, and snippets.

@ezhulenev
Forked from munhitsu/gist:1034876
Last active September 2, 2016 01:50
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ezhulenev/329efd28da8ca51d9f5f to your computer and use it in GitHub Desktop.
Python on Mac OS + virtualenvwrapper
# In case you had some strange python installation
# NOTE: .pydistutils.cfg seems to be not compatible with brew install python
# areas I needed to clean before installation
# clean up ~/Library/Python
# clean up .local
# preconditions:
# xcode with command line tools installed
xcode-select --install
# homebrew: https://github.com/mxcl/homebrew/wiki/Installation
brew install python --framework
#### update/create your .bash_profile
#homebrew
export PATH=/usr/local/bin:/usr/local/sbin:${PATH}
#virtualenv wrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
#### end of .bash_login
# start new shell and make sure you are using /usr/local/bin/python
# note that it will complain that /usr/local/bin/virtualenvwrapper.sh does not exist
# as we havent installed virtualenvwrapper yet
which python
python --version
# make sure its python >=2.7.5
# time to install virtualenvironment
pip install virtualenvwrapper
mkdir $HOME/.virtualenvs
# start new shell and from now on you will have access to mkvirtualenv
# NOTE: that the only time you should be asked for yout password is during homebrew installation
# if all goes correctly than none of above commands would ask you for your passoword / would want you to use sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment