Jupyter Notebook Installation

59,135

Solution 1

Ubuntu 22.04 and later

sudo apt install epiphany jupyter-notebook

Create jupyter_notebook_config.py by:

jupyter notebook --generate-config # type y for yes at the prompt

Then open ~/.jupyter/jupyter_notebook_config.py for editing in a text editor and change:

# c.NotebookApp.browser = ''

to:

c.NotebookApp.browser = '/usr/bin/epiphany'

Don't forget to delete the # at the beginning of the line so it's not a comment anymore. You can use a different web browser if you don't like Web as long as it's not a snap package and you change the path from /usr/bin/epiphany to the path to your web browser which you can find by running a command of the form which my-web-browser.

It still won't work though, so you have to do one more step. Change the ownership of the ~/.local/share/jupyter directory from root to user. Instead of user in the below command replace it with your own username that you login with.

sudo chown -R user:user ~/.local/share/jupyter 

Ubuntu 20.04

Open the terminal and type:

sudo apt install jupyter-notebook jupyter # jupyter is optional

Ubuntu 18.04-19.10

Open the terminal and type:

sudo apt install python3-notebook jupyter jupyter-core python-ipykernel 

To start the notebook server run the following command:

jupyter notebook

You should see Jupyter Notebook open in your web browser.


Ubuntu 17.04 and 17.10

In Ubuntu 17.04 and later Jupyter Notebook is available in the default Ubuntu repositories and can be quickly and easily installed using apt. Open the terminal and type:

sudo apt install jupyter-notebook jupyter-core python-ipykernel 

python-ipykernel is necessary for running Python 2.x programs in Jupyter Notebook, which otherwise supports only Python 3.x.

To start the notebook server run the following command:

jupyter notebook

You should see Jupyter Notebook open in your web browser

Ubuntu 16.04 and earlier

Google Colaboratory is Google's free Jupyter notebook environment that requires no setup and runs entirely in the cloud.

Solution 2

I installed it using

pip install jupyter

(pip3 if Python3 is installed; also, ensure you have root access, i.e. logged in to the terminal as root@...)

and for python dependencies

apt-get install build-essential python3-dev

In ubuntu desktop 14.04.3 LTS. I am on python3.

Share:
59,135

Related videos on Youtube

karfai
Author by

karfai

Updated on September 18, 2022

Comments

  • karfai
    karfai over 1 year

    Is it possible to install Jupyter Notebook through apt-get install? For example, we can install numpy by using apt-get install python-numpy.

  • Ashu
    Ashu about 8 years
    @EdwardSiew. I don't think so. I was following one of the training sessions...they also mentioned to install it this way only.
  • AVINASH ANAND
    AVINASH ANAND over 7 years
    What if we don't have the root access?
  • Hendy
    Hendy almost 7 years
    @AVINASHANAND probably useless a year later, but perhaps this: pip install --user pkg_name.
  • Boba Fit
    Boba Fit about 5 years
    I get following error: $jupyter notebook Error executing Jupyter command 'notebook': [Errno 2] No such file or directory
  • karel
    karel about 5 years
    The command jupyter-troubleshoot will help you to troubleshoot this problem.
  • Boba Fit
    Boba Fit about 5 years
    I removed a lot of python packages and reinstalled them. Now it works, but I dont know why. But thats fine for me. Thank you.
  • Felix
    Felix almost 5 years
    You also need apt-get install jupyter-notebook, as suggested here: stackoverflow.com/questions/42648610/…
  • karel
    karel over 4 years
    This answer is a duplicate of this existing answer: askubuntu.com/questions/737094/jupyter-notebook-installation‌​/…
  • mike
    mike over 3 years
    Ubuntu 20.04 users can use the 18.04 command above, but should not include python-ipykernel.
  • Ashu
    Ashu over 3 years
    @AVINASHANAND you should be able to do sudo to do the same.
  • dmvianna
    dmvianna almost 3 years
    Looks like in 20.04 apt-get install jupyter-notebook is enough.