Sunday, August 21, 2016

Install Jupyter Notebook on Ubuntu 16.04

The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.

I use Jupyter notebook to document R, Python and Spark scripts, I`ll put the configuration and setting up R on another post later on

Prerequisite - Python3 & Python3-pip

The default python installation for ubuntu16.04 is python 2 so we need to make sure that python3 and python3-pip is installed
sudo apt-get install python3
sudo apt-get install python3-pip

Prerequisite - configurable-http-proxy on nodejs

And the second requirement for jupyter is the configurable-http-proxy which available on nodejs, we have to install that too
sudo apt-get install npm nodejs-legacy
sudo npm install -g configurable-http-proxy

Install Jupyterhub

finally we can install jupyterhub
sudo pip3 install jupyterhub

in some cases there's a directory access problem that provide this errors
The directory '/home/svision/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/svision/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
we need to add -H flag in order for that to work
sudo -H pip3 install jupyterhub
then you need to upgrade the jupyterhub installation right away
sudo -H pip3 install --upgrade notebook

Running Jupyterhub

Then you can run jupyterhub with this command
sudo jupyterhub
Please note that jupyterhub will create several files in the directory where you type the commands, so please run it on your home directory

No comments :

Post a Comment