Sunday, May 3, 2015

How to install IPython Notebook + matplotlib + GraphLab Create

tl;dr: these instructions *work*. I'm publishing them here mainly to make them quickly accessible for my own use.

Install the following to get a fully working IPython Notebook:

$ sudo apt-get install python-dev
$ sudo apt-get install libzmq3-dev
$ sudo pip install pyzmq
$ sudo pip install jinja2
$ sudo pip install pygments
$ sudo pip install tornado
$ sudo pip install jsonschema
$ sudo pip install ipython
$ sudo pip install "ipython[notebook]"


If you want to use this machine as a server, follow these instructions:

These instructions including creating an SSL key pair so that you can access the IPython server via https from a remote machine.


Additionally, install this to get a fully working matplotlib:

$ sudo apt-get install libpng-dev
$ sudo apt-get install libfreetype6
$ sudo apt-get install libfreetype6-dev
$ sudo apt-get install g++
$ sudo pip install matplotlib


And finally, install GraphLab Create:

$ pip install graphlab-create

Note: for GraphLab Create to work, your Python instance should be built with the UCS4 flag. To check if that was the case:

(Taken from: http://stackoverflow.com/questions/1446347/how-to-find-out-if-python-is-compiled-with-ucs-2-or-ucs-4 )

When built with --enable-unicode=ucs4:
>>> import sys
>>> print sys.maxunicode
1114111
When built with --enable-unicode=ucs2:
>>> import sys
>>> print sys.maxunicode
65535



GraphLab Create Product Key Setup

After GraphLab is installed, you need to get a product key from dato.com (for free, after a simple and short registration). When you register, you receive the product key within a script for installing it into the appropriate directory. In case you lost the script and only have the product key, you can also set it via GraphLab itself.

$ python
>>> import graphlab as gl
>>> gl.product_key.set_product_key("PRODUCT KEY OBTAINED FROM DATO AFTER REGISTRATION")