We can install jupyter notebook in ubuntu 20.04. you need to have anaconda installed on the machine. Let’s see, how to install jupyter on ubuntu.
Jupyter is an open-source web application that allows you to create and share documents that contain live codes with narrative text and equations.
How To Install Jupyter Notebook On Ubuntu 20.04 / 19.10
Once you have installed the above packages, you need to install jupyterlab and conda-forge package on ubuntu.
conda install -c conda-forge jupyterlab
Install the Jupyter core using the below command and press “y” to continue the installation.
ubuntu@ubuntu:~/Desktop$ sudo apt install jupyter-core Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: python3-decorator python3-ipython-genutils python3-jupyter-core python3-traitlets The following NEW packages will be installed: jupyter-core python3-decorator python3-ipython-genutils python3-jupyter-core python3-traitlets 0 upgraded, 5 newly installed, 0 to remove and 19 not upgraded. Need to get 138 kB of archives. After this operation, 804 kB of additional disk space will be used. Do you want to continue? [Y/n] y
Installing ipython and jupyter using the PIP command:
Use the below command to install them and This process can take time, totally depends on your internet speed. Create a directory at /opt/lvmfolder
sudo mkdir -p /opt/lvmfolder/jupyter cd /opt/lvmfolder/jupyter sudo apt-get -y install ipython sudo pip3 install jupyter
You can check the jupyter version.
ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter --version jupyter core : 4.6.3 jupyter-notebook : 6.1.3 qtconsole : not installed ipython : 7.18.1 ipykernel : 5.3.4 jupyter client : 6.1.7 jupyter lab : not installed nbconvert : 5.6.1 ipywidgets : not installed nbformat : 5.0.7 traitlets : 4.3.3
Once the command is completed. we can start jupyter notebook. You can also start jupyter with non-root users as well. I will start juypter as root by using the flag –allow-root
ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter notebook --allow-root [I 03:20:49.247 NotebookApp] Writing notebook server cookie secret to /home/ubuntu/.local/share/jupyter/runtime/notebook_cookie_secret [I 03:20:49.478 NotebookApp] Serving notebooks from local directory: /opt/lvmfolder/jupyter [I 03:20:49.478 NotebookApp] Jupyter Notebook 6.1.3 is running at: [I 03:20:49.478 NotebookApp] http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3 [I 03:20:49.479 NotebookApp] or http://127.0.0.1:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3 [I 03:20:49.479 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 03:20:49.628 NotebookApp] To access the notebook, open this file in a browser: file:///home/ubuntu/.local/share/jupyter/runtime/nbserver-11133-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3 or http://127.0.0.1:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f3
Pick up any of the URL to hit in the browser and you will see the output like:
When you will create any file inside the directory /op/lvmfolder/jupyter and those files will automatically be uploaded on the notebook.
ubuntu@ubuntu:/opt/lvmfolder/jupyter$ ls testingfile tokenlink
Now refresh the URL:
You can also create any file using the portal and click on “New“.
You can check the token using the below command.
ubuntu@ubuntu:/opt/lvmfolder/jupyter$ jupyter notebook list Currently running servers: http://localhost:8888/?token=27f3b3243eb0cadf9fbf527a4ffe18f59d6fc4f692d07f23 :: /opt/lvmfolder/jupyter
We will logout and login again with the above token and you will be able to log in.