Install Jupyter Notebook in Ubuntu 20.04 and later
Open the terminal and type:
sudo apt install python3-notebook jupyter jupyter-core
Install Jupyter Notebook in 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.
Install Jupyter Notebook in Ubuntu 14.04→16.10
The default version of Python in Ubuntu works OK, but pip needs to be updated to the latest version.
sudo apt-get update
sudo apt-get -y install python-pip python-dev
sudo -H pip install --upgrade pip
sudo apt-get -y install ipython ipython-notebook
pip install --user jupyter
If you are using Python 3.x, run these commands instead:
sudo apt-get update
sudo apt-get -y install python3-pip python3-dev
sudo -H pip3 install --upgrade pip
sudo apt-get -y install ipython3 ipython3-notebook
pip3 install --user jupyter
To start Jupyter Notebook, run the following command:
jupyter notebook
If you also have python-matplotlib installed, the first line of code to enable plotting in the current Notebook is %matplotlib inline
It is possible to use Python 3 in Jupyter Notebook for Python 2 by adding the kernel for Python 2. If you're running Jupyter on Python 3, you can set up a Python 2 kernel like this:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
Install Jupyter Notebook in 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.
I faced similar issue. This is what I did to fix the issue (on Ubuntu 16.04):
sudo apt-get remove ipython
sudo apt-get purge ipython
sudo apt-get autoremove
pip install jupyter
ipython seemed to be the problem, hence removing it fixed the issue.
I'm now able to run jupyter notebook
Best Answer
Ubuntu 20.04 and later
Open the terminal and type:
Ubuntu 18.04-19.10
Open the terminal and type:
To start the notebook server run the following command:
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:
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:
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.