{"id":526,"date":"2013-06-08T04:40:28","date_gmt":"2013-06-08T02:40:28","guid":{"rendered":"http:\/\/joernhees.de\/blog\/?p=526"},"modified":"2016-09-28T23:15:19","modified_gmt":"2016-09-28T21:15:19","slug":"mac-os-x-10-8-scientific-python-with-homebrew","status":"publish","type":"post","link":"https:\/\/joernhees.de\/blog\/2013\/06\/08\/mac-os-x-10-8-scientific-python-with-homebrew\/","title":{"rendered":"Scientific Python on Mac OS X 10.8 with homebrew"},"content":{"rendered":"<p>(<a href=\"http:\/\/joernhees.de\/blog\/2014\/02\/25\/scientific-python-on-mac-os-x-10-9-with-homebrew\/\" title=\"newer version of this guide\">newer version of this guide<\/a>)<\/p>\n<p>A step-by-step installation guide to setup a scientific python environment based on Mac OS X and homebrew.<\/p>\n<p>Needless to say: Make a backup (Timemachine)<\/p>\n<p>First install <a href=\"http:\/\/brew.sh\" target=\"_blank\">homebrew<\/a>.<br \/>\nFollow their instructions, then come back here.<\/p>\n<p>If you don&#8217;t have a clean install, some of the following steps might need minor additional attention (like changing permissions <code>chmod<\/code>, <code>chown<\/code>, <code>chgrp<\/code> or overwriting existing files in the linking step with <code>brew link --overwrite package_that_failed<\/code>. In this case i can only recommend a backup again).<\/p>\n<p>In general: execute the following commands one line at a time and read the outputs! If you read some warnings about &#8220;keg-only&#8221; that&#8217;s fine, it just means that brew won&#8217;t &#8220;hide&#8221; your system&#8217;s stuff behind the stuff it installed itself so it doesn&#8217;t cause problems&#8230; brewed stuff will still use it.<\/p>\n<pre><code class=\"bash\"># set up some taps and update brew\nbrew tap homebrew\/science # a lot of cool formulae for scientific tools\nbrew tap homebrew\/python # numpy, scipy\nbrew update &amp;&amp; brew upgrade\n\n# install a brewed python\nbrew install python\n\n# install openblas (otherwise scipy's arpack tests will fail)\nbrew install openblas\n\n# install PIL, imagemagick, graphviz and other\n# image generating stuff (qt is nice for viewing)\nbrew install pillow imagemagick graphviz\nbrew install cairo --without-x\nbrew install py2cairo # this will ask you to download xquartz and install it\nbrew install qt pyqt\n\n# install nose (unittests &amp; doctests on steroids)\npip install virtualenv nose\n\n# install numpy and scipy\nbrew install numpy --with-openblas # bug in Accelerate framework &lt; Mac OS X 10.9\nbrew install scipy --with-openblas # bug in Accelerate framework &lt; Mac OS X 10.9\n\n# test the scipy install\nbrew test scipy\n\n# some cool python libs (if you don't know them, look them up)\n# time series stuff, natural language toolkit\n# generate plots, symbolic maths in python, fancy debugging output\npip install pandas nltk matplotlib sympy q\n\n# ipython and notebook support\nbrew install zmq\npip install ipython[zmq,qtconsole,notebook,test]\n\n# html stuff (parsing)\npip install html5lib cssselect pyquery lxml BeautifulSoup\n\n# webapps \/ apis (choose what you like)\npip install Flask Django\n\n# semantic web stuff: rdf &amp; sparql\npip install rdflib SPARQLWrapper\n\n# picloud (easily run python scripts in the cloud)\npip install cloud\n<\/code><\/pre>\n<p>Have fun \ud83d\ude09<\/p>\n<p>(As always: If you think something is missing leave a comment.)<\/p>\n<p>&#8212;<br \/>\nupdate 2014-02-25: updated tap samualjohn\/python to homebrew\/python, new version linked<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(newer version of this guide) A step-by-step installation guide to setup a scientific python environment based on Mac OS X and homebrew. Needless to say: Make a backup (Timemachine) First install homebrew. Follow their instructions, then come back here. If you don&#8217;t have a clean install, some of the following steps might need minor additional [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[20,57,69,77,96,132,146,147,156,171],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pYA5n-8u","jetpack-related-posts":[{"id":566,"url":"https:\/\/joernhees.de\/blog\/2014\/02\/25\/scientific-python-on-mac-os-x-10-9-with-homebrew\/","url_meta":{"origin":526,"position":0},"title":"Scientific Python on Mac OS X 10.9+ with homebrew","date":"2014-02-25","format":false,"excerpt":"Scientific python setup guide for Mac OS X 10.9 Mavericks with homebrew","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":81,"url":"https:\/\/joernhees.de\/blog\/2010\/07\/19\/min-heap-in-python\/","url_meta":{"origin":526,"position":1},"title":"Min-Heap in Python","date":"2010-07-19","format":false,"excerpt":"I recently wanted to implement a small event system where events can have different priorities. So for example the event with highest priority (lowest value) should be handled first. Python comes with a heapq module which can transform a list into a heap in a way that it stays a\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":584,"url":"https:\/\/joernhees.de\/blog\/2014\/04\/23\/setting-up-a-local-dbpedia-3-9-mirror-with-virtuoso-7\/","url_meta":{"origin":526,"position":2},"title":"Setting up a local DBpedia 3.9 mirror with Virtuoso 7","date":"2014-04-23","format":false,"excerpt":"Newer version available: Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuso 7.2.1 and Docker (optional) I just found this aged post in my drafts folder, maybe someone will still like it... So you're the guy who is allowed to setup a\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":360,"url":"https:\/\/joernhees.de\/blog\/2011\/09\/16\/mac-os-x-harddisk-high-load-cycle-counts\/","url_meta":{"origin":526,"position":3},"title":"Mac OS X Harddisk high Load Cycle Counts","date":"2011-09-16","format":false,"excerpt":"Mac OS X's default power management settings might wear your hard drive down unnecessarily. This post provides a lot of background information and how to change these settings.","rel":"","context":"In \"193\"","img":{"alt_text":"","src":"https:\/\/i2.wp.com\/joernhees.de\/blog\/wp-content\/uploads\/2011\/09\/RampLoadUnloadDynamics.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":442,"url":"https:\/\/joernhees.de\/blog\/2012\/05\/25\/setting-up-a-local-dbpedia-3-7-mirror-with-virtuoso-6-1-5\/","url_meta":{"origin":526,"position":4},"title":"Setting up a local DBpedia 3.7 mirror with Virtuoso 6.1.5+","date":"2012-05-25","format":false,"excerpt":"Newer version available: Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuso 7.2.1 and Docker (optional) Nearly 1.5 years after i initially published a post about how to setup a local DBpedia mirror i recently revisited the problem myself to setup a\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":277,"url":"https:\/\/joernhees.de\/blog\/2010\/10\/31\/setting-up-a-local-dbpedia-mirror-with-virtuoso\/","url_meta":{"origin":526,"position":5},"title":"Setting up a local DBpedia mirror with Virtuoso","date":"2010-10-31","format":false,"excerpt":"So you're the guy who is allowed to setup a local DBpedia mirror for your work group? OK, today is your lucky day and you're in the right place. I hope you'll be able to benefit from my hours of trials and errors ;)","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/526"}],"collection":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":2,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/526\/revisions\/787"}],"wp:attachment":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}