Last active
December 5, 2016 23:19
-
-
Save evansde77/4a02df025bf72b7774234e2561126737 to your computer and use it in GitHub Desktop.
Python Environment Setup on MacOSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# assumes that XCode and XCode command line tools have been installed | |
# xcode-select --install | |
# assumes that gfortran has been installed | |
# https://gcc.gnu.org/wiki/GFortranBinaries | |
# install pyenv & set 2.7.11 as current | |
# See: https://github.com/yyuu/pyenv-installer | |
# See: https://github.com/yyuu/pyenv | |
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash | |
pyenv install 2.7.11 | |
pyenv install 3.5.1 | |
pyenv global 2.7.11 3.5.1 # makes 2.7.11 the default and as python2.7, makes 3.5.1 available as python3.5 | |
# install pip | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
python2.7 get-pip.py | |
python3.5 get-pip.py | |
# Install virtualenv | |
pip2.7 install virtualenv | |
pip3.5 install virtualenv | |
# create a new project for data analysis with jupyter using python2.7 | |
virtualenv venv | |
. venv/bin/activate | |
pip install pyzmq --install-option="--zmq=bundled" # avoids library path issues with libzmq | |
pip install pandas | |
pip install scipy | |
pip install scikit-learn | |
pip install vincent | |
pip install jupyter | |
deactivate # when done with this virtualenv | |
# create a new project using python3.5 setting 3.5 as the default based on directory location: | |
mkdir py3.5 | |
cd py3.5 | |
pyenv local 3.5.1 # sets python3.5 as default when you cd into this dir | |
virtualenv venv | |
. venv/bin/activate | |
# pip install as before |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment