Skip to content

Instantly share code, notes, and snippets.

@sanjeevbadgeville
Created March 2, 2016 23:17
Show Gist options
  • Select an option

  • Save sanjeevbadgeville/adfaa196dd386aca2516 to your computer and use it in GitHub Desktop.

Select an option

Save sanjeevbadgeville/adfaa196dd386aca2516 to your computer and use it in GitHub Desktop.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# set up some taps and update brew
brew tap homebrew/science # a lot of cool formulae for scientific tools
brew tap homebrew/python # numpy, scipy, matplotlib, ...
brew update && brew upgrade
# install a brewed python
brew install python
hash -r python # invalidate bash's lookup cache for python
which python
# should say /usr/local/bin/python
echo $PATH
# /usr/local/bin should appear in front of /usr/bin
# install PIL, imagemagick, graphviz and other
# image generating stuff
brew install libtiff libjpeg webp little-cms2
pip install Pillow
brew install imagemagick --with-fftw --with-librsvg --with-x11
brew install graphviz --with-librsvg --with-x11
brew install cairo
brew install py2cairo # this will ask you to download xquartz and install it
brew install qt pyqt
# install virtualenv, nose (unittests & doctests on steroids)
pip install virtualenv
pip install nose
# install numpy and scipy
# there are two ways to install numpy and scipy now: via pip or via brew.
# PICK ONE, i prefer pip for proper virtualenv support and more up-to-date versions.
pip install numpy
pip install scipy
# OR:
# (if you want to run numpy and scipy with openblas also remove comments below:)
#brew install openblas
brew install numpy # --with-openblas
brew install scipy # --with-openblas
# test the numpy & scipy install
python -c 'import numpy ; numpy.test();'
python -c 'import scipy ; scipy.test();'
# some cool python libs (if you don't know them, look them up)
# matplotlib: generate plots
# pandas: time series stuff
# nltk: natural language toolkit
# sympy: symbolic maths in python
# q: fancy debugging output
# snakeviz: cool visualization of profiling output (aka what's taking so long?)
#brew install Caskroom/cask/mactex # if you want to install matplotlib with tex support and don't have mactex installed already
brew install matplotlib --with-cairo --with-tex # cairo: png ps pdf svg filetypes, tex: tex fonts & formula in plots
pip install pandas
pip install nltk
pip install sympy
pip install q
pip install snakeviz
# ipython with parallel and notebook support
brew install zmq
pip install ipython[all]
# html stuff (parsing)
pip install html5lib cssselect pyquery lxml BeautifulSoup
# webapps / apis (choose what you like)
pip install Flask Django tornado
# semantic web stuff: rdf & sparql
pip install rdflib SPARQLWrapper
# graphs (graph metrics, social network analysis, layouting)
pip install networkx
# maintenance: updating of pip libs
pip list --outdated # see Updating section below
brew update && brew outdated && brew upgrade --all
pip install -U package1 package2 ...
pip install pip-review
pip install -U jupyter
ipython console --kernel scala211
jupyter notebook --port 9999
# R: install.packages(c('repr', 'IRkernel', 'IRdisplay'),
# repos = c('http://irkernel.github.io/', getOption('repos')))
# IRkernel::installspec(user = FALSE)
# update.packages(repos = c('http://irkernel.github.io/', getOption('repos')))
brew uninstall zeromq
brew install homebrew/versions/zeromq405
# Test: m <- data.frame(c(1:10),c(11:20))
References:
https://joernhees.de/blog/2014/02/25/scientific-python-on-mac-os-x-10-9-with-homebrew/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment