ImportError: No module named notebook.notebookapp
Asked Answered
B

12

176

What do you recommend guys for this error when I type in console ipython notebook and got

ImportError: No module named notebook.notebookapp

?

I installed ipython notebook with pip and really I don't know what is going on.

Bill answered 14/7, 2015 at 8:44 Comment(1)
I've tried every single answer here and none of them fix my ModuleNotFoundError: No module named 'notebook.notebookapp' error when trying to run python manage.py shell_plus --notebook even though the notebook (jupyter notebook) seems to run fine otherwise...Harold
E
315

For 4.0 and above You need to install the notebook app separately from https://github.com/jupyter/notebook

pip install jupyter
Eohippus answered 16/7, 2015 at 16:0 Comment(5)
Correct. pip install jupyter is enough to fix the error and launch the notebook.Legman
Or pip3 install jupyter if you're on a system where Python 3 is the defaultDisgrace
If ipyton notebook <notebook> doesn't work for you, @meduz mentioned in a comment below that running jupyter notebook <notebook may work instead. That resolved the issue for me.Brittani
I have different python versions and pip3.6 install jupyter did the jobHahnke
i get same error even after doing pip install jupyterEmpery
M
20

conda install jupyter will install latest jupyter along with other required dependencies

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
mistune-0.7                |           py27_0         186 KB
jinja2-2.8                 |           py27_0         263 KB
jupyter_core-4.0.3         |           py27_0          25 KB
tornado-4.2.1              |           py27_0         515 KB
jupyter_client-4.0.0       |           py27_0          88 KB
nbformat-4.0.0             |           py27_0         112 KB
ipykernel-4.0.3            |           py27_0         111 KB
nbconvert-4.0.0            |           py27_0         266 KB
jupyter_console-4.0.0      |           py27_0          22 KB
notebook-4.0.1             |           py27_0         4.2 MB
qtconsole-4.0.0            |           py27_0         120 KB
ipywidgets-4.0.2           |           py27_0          93 KB
jupyter-1.0.0              |           py27_0           2 KB
------------------------------------------------------------
                                       Total:         6.0 MB
Miracle answered 16/8, 2015 at 3:41 Comment(1)
Anaconda installation users only.Resa
J
11

This two commands will fix most problems for you:

sudo pip install --upgrade setuptools pip
sudo pip install --upgrade "ipython[all]"
Jonijonie answered 1/6, 2016 at 12:25 Comment(0)
S
8

I got the same problem when upgrading ipython. This is a bug linked to the latest 4 version, I recommend you switch back to the stable version 3.2.1:

pip uninstall -y ipython
pip install ipython==3.2.1
Superpose answered 15/7, 2015 at 9:35 Comment(5)
Works like a charm, but I additionally had to upgrade pip (sudo pip install -U pip) and a few packages via pip.Author
See other answer: pip install jupyter.Tailor
As @joeh said, it is recommended to upgrade to jupyter and to use the jupyter notebook command instead of ipython notebook one.Superpose
disclaimer: this answer was given in 2015 - please regard this as a solution which relevance is mainly historical :-)Superpose
Agree with above. Unless you are using an old Python version then this will likely cause many issues.Harold
K
4

this is what it worked for me:

pip install -U notebook
Kolnos answered 24/1, 2021 at 21:44 Comment(0)
B
1

if you are using python version 2

pip install jupyter

in case using python 3.x

pip3 install jupyter

to be on the safe side also check that notebook module is installed or not

pip install notebook

or

pip3 install notebok

Beating answered 13/3, 2019 at 7:11 Comment(0)
S
1

Go to the path that will appear for you for example: C:\Users\Soft\anaconda3\Scripts\jupyter-notebook-script.py and change notebook.notebookapp to just notebook.app. This worked for me.

Suckow answered 25/8, 2023 at 16:11 Comment(0)
D
1

Just run

python manage.py shell_plus  --lab

and if you are running inside a docker container:

python manage.py shell_plus  --lab -- --allow-root --no-browser  --ServerApp.ip 0.0.0.0
Dardar answered 28/3 at 20:16 Comment(0)
M
0

Try this:

pip install jupyter

It is worked for me.

Materiality answered 2/2, 2017 at 14:8 Comment(0)
K
0

Install Specific Version:

pip install jupyter

Upgrade jupyter

sudo pip3 install --upgrade jupyter

Getting Dependency Error in Window 10 Use code: easy_install instead of pip install

easy_install jupyter 

Upgrade using easy install

sudo easy_install --upgrade  jupyter

On OSX System to install Module: Use code: brew install instead of pip install

brew install jupyter 

Without Using Pip :

 sudo apt-get install -y jupyter 

On CentOS7 or Linux Fedora:

yum -y install jupyter 

Or on Fedora try

sudo dnf install jupyter 

Command if Homebrew screws up your path on macOS:

python -m pip install jupyter 

For Python3 MacOs Homebrew screws

python3 -m pip install jupyter

Verify module from list MacOs

pip freeze | grep  jupyter

For Execute on Anaconda as your python package manager

 conda install -c anaconda jupyter 
Kurman answered 27/3, 2021 at 7:21 Comment(0)
F
0

from the env path C:\Users\awatim\envs\ds2\Scripts\jupyter-notebook-script.py

Replacing notebook.notebookapp to just notebook.app is worked for me also

as above Abdelrahman Elaraby has mentioned same.

Foretaste answered 31/8, 2023 at 12:7 Comment(0)
H
0

NoModuleFoundError: notebook.notebookapp

It is because you imported the notebookapp module from the wrong folder, the notebookapp module you are trying to use is not in the notebook folder.

Go to the file location where the jupyter-notebook-script.py and open it in VS code. Now run this file and check the same error you occurred when trying to open the Jupyter Notebook from cmd prompt or from anything.

If the same error occurs then go to this file location C:\ProgramData\anaconda3 and search the { notebookapp } python now to go to the file location by cliking the left click on that file and you will get the option that is open file location now click on that.

You will directed to the location of that file. Now the most important, find out the folder in which this ( notebookapp ) file is stored.

In my case it was found in the nbclassic folder.

Open the file/script jupyter-notebook-script.py in vs code or any IDE and change the code like below. notebook changes to nbclassic

Before updating


import re
import sys

from notebook.notebookapp import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

After Updating


import re
import sys

from nbclassic.notebookapp import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Change the code like that in my case it is found in nbclassic folder thats why i am importing from that.

from nbclassic.notebookapp import main

This will definitely work if you have the same error.

Hangbird answered 23/9, 2023 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.