How to To Install Jupyter on Ubuntu 18.04

How to To Install Jupyter on Ubuntu 18.04

Jupyter Notebook is an open-source web application used for creating and sharing documents which have the live code, equations, visualizations and explanatory text. It includes data cleaning and transformation, numerical simulation, statistical modeling, machine learning, etc. It is really so simple to install Jupyter on Ubuntu 18.04 and this tutorial covers the ground on the same process.

Installing Jupyter

The foremost thing to do before installing Jupyter is to add all the required dependency packages to your system, so run the following command to install those dependencies, and also, since Python is necessary for the installation you should also verify the Python version using the following command.

root@linuxhelp:~# python --version
Python 2.7.14+

Now we have to Install dependencies required for the installation.

root@linuxhelp:~# apt-get install python-pip python-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Use ' apt autoremove'  to remove them.
The following additional packages will be installed:
.
.
Setting up libpython-all-dev:amd64 (2.7.14-4) ...
Setting up gcc (4:7.3.0-3ubuntu2) ...
Setting up python-all-dev (2.7.14-4) ...
Setting up g++ (4:7.3.0-3ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.4ubuntu1) ...
Processing triggers for libc-bin (2.27-0ubuntu2) ...

Once done, upgrade the pip too, so run the following command.

root@linuxhelp:~# pip install --upgrade pip
The directory ' /home/user1/.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/user1/.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.
Collecting pip
  Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 466kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-9.0.3

Now is the time to install Jupyter. Triger the installation process by executing the following command.

root@linuxhelp:~# pip install jupyter
The directory ' /home/user1/.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/user1/.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.
Collecting jupyter
  Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
  Downloading nbconvert-5.3.1-py2.py3-none-any.whl (387kB)
    100% |████████████████████████████████| 389kB 2.0MB/s 
Collecting ipywidgets (from jupyter)
  Downloading ipywidgets-7.2.1-py2.py3-none-any.whl (106kB)
    100% |████████████████████████████████| 112kB 1.2MB/s 
Collecting qtconsole (from jupyter)
  Downloading qtconsole-4.3.1-py2.py3-none-any.whl (108kB)
    100% |████████████████████████████████| 112kB 1.2MB/s
.
.
Successfully installed MarkupSafe-1.0 Send2Trash-1.5.0 backports-abc-0.5 backports.shutil-get-terminal-size-1.0.0 bleach-2.1.3 configparser-3.5.0 decorator-4.2.1 entrypoints-0.2.3 functools32-3.2.3.post2 html5lib-1.0.1 ipykernel-4.8.2 ipython-5.6.0 ipython-genutils-0.2.0 ipywidgets-7.2.1 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.2.3 jupyter-console-5.2.0 jupyter-core-4.4.0 mistune-0.8.3 nbconvert-5.3.1 nbformat-4.4.0 notebook-5.4.1 pandocfilters-1.4.2 pathlib2-2.3.0 pexpect-4.5.0 pickleshare-0.7.4 prompt-toolkit-1.0.15 ptyprocess-0.5.2 pygments-2.2.0 python-dateutil-2.7.2 pyzmq-17.0.0 qtconsole-4.3.1 scandir-1.7 simplegeneric-0.8.1 singledispatch-3.4.0.3 terminado-0.8.1 testpath-0.3.1 tornado-5.0.2 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.2.1

Jupyter has been installed, run the following command to start Jupyter notebook.

root@linuxhelp:~# jupyter notebook --allow-root
[I 04:12:38.206 NotebookApp] Writing notebook server cookie secret to /home/user1/.local/share/jupyter/runtime/notebook_cookie_secret
[I 04:12:38.663 NotebookApp] Serving notebooks from local directory: /home/user1
[I 04:12:38.663 NotebookApp] 0 active kernels
[I 04:12:38.664 NotebookApp] The Jupyter Notebook is running at:
[I 04:12:38.664 NotebookApp] http://localhost:8888/?token=7a761a8de8e07b774fb1971503ad69dffa48b058598ac903
[I 04:12:38.664 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 04:12:38.665 NotebookApp] 
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=7a761a8de8e07b774fb1971503ad69dffa48b058598ac903
[I 04:12:55.942 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[I 04:13:22.434 NotebookApp] Creating new directory in 
[I 04:13:35.541 NotebookApp] Creating new directory in 
[W 04:14:39.432 NotebookApp] delete /Untitled Folder 1
[I 04:14:59.713 NotebookApp] Creating new file in 
[I 06:29:53.174 NotebookApp] 302 GET /edit/untitled.txt (127.0.0.1) 75.78ms

Once the Jupyter notebook launches in a web browser, your screen may look like the following image.

You can create a new folder by clicking on New button available on the top right corner.

To delete a folder, mark the folder and use delete icon in the top left.

To rename the folder mark the folder and rename.


You can create a new notebook by clicking on New button available on the top right corner.


With this, the method to Install Jupyter on Ubuntu 18.04 comes to an end.

Tag : Ubuntu jupyter
FAQ
Q
What is mean by kernel notebook in Jupyter?
A
A notebook kernel is a “computational engine” that executes the code contained in a Notebook document. The ipython kernel, referenced in this guide, executes python code. Kernels for many other languages exist (official kernels).

When you open a Notebook document, the associated kernel is automatically launched. When the notebook is executed (either cell-by-cell or with menu Cell -> Run All), the kernel performs the computation and produces the results. Depending on the type of computations, the kernel may consume significant CPU and RAM. Note that the RAM is not released until the kernel is shut-down. The official link to refer the kernel notebook in Jupyter "https://jupyter.readthedocs.io/en/latest/#kernels"
Q
What is the Jupyter Notebook?
A
In this page briefly introduce the main components of the Jupyter Notebook environment. For a more complete overview see "https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html#references"
Q
How to install a prerelease version such as a beta or release candidate for Jupyter application?
A
For the installation of prerelease version such as a beta or release candidate for Jupyter application, use the command as follow "python -m pip install notebook --pre --upgrade".
Q
what is the Alternatives to token authentication in Jupyter?
A
If a generated token doesn’t work well for you, you can set a password for your notebook. jupyter notebook password will prompt you for a password, and store the hashed password in your jupyt
Q
Can you give me the documentation for the user interface components detail for Jupyter?
A
Use the following link to get official documentation for user interface components detail for Jupyter as "https://jupyter-notebook.readthedocs.io/en/stable/ui_components.html"