Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'notebook.notebookapp' #23945

Closed
ahmedsza opened this issue Jul 20, 2023 · 16 comments
Closed

ModuleNotFoundError: No module named 'notebook.notebookapp' #23945

ahmedsza opened this issue Jul 20, 2023 · 16 comments

Comments

@ahmedsza
Copy link

Type: Bug

I get this error when trying to activate Python3 kernel. I have tried to install ADS new, from zip. I have tried existing Python install and new. In all cases it fails

Failed to change kernel. Kernel SQL will be used. Error was: Notebook process exited prematurely with error code: 1. StdErr Output: Traceback (most recent call last):
File "c:\Users<username>\AppData\Local\Programs\Azure Data Studio\resources\app\extensions\notebook\resources\pythonScripts\startNotebook.py", line 1, in
import notebook.notebookapp
ModuleNotFoundError: No module named 'notebook.notebookapp'

Tried to do pip install notebook as per many suggestions on stackoverflow.
tried
pip uninstall notebook
pip install notebook

tried
pip install --upgrade pip setuptools

no luck :-(

Azure Data Studio version: azuredatastudio 1.44.1 (8f53a31, 2023-06-01T02:12:48.765Z)
OS version: Windows_NT x64 10.0.22621
Restricted Mode: No
Preview Features: Disabled
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 63.71GB (29.02GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none
@alaninspace
Copy link

Same for me, even when configuring a new runtime @ C:\Users\xyz\azuredatastudio-python

"Failed to change kernel. Kernel SQL will be used. Error was: Notebook process exited prematurely with error code: 1. StdErr Output: Traceback (most recent call last):
File "c:\Program Files\Azure Data Studio\resources\app\extensions\notebook\resources\pythonScripts\startNotebook.py", line 1, in
import notebook.notebookapp
ModuleNotFoundError: No module named 'notebook.notebookapp'"

Version: 1.44.1 (system setup)
Commit: 8f53a31
Date: 2023-06-01T02:12:48.765Z
VS Code: 1.70.0
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19045

@ahmedsza
Copy link
Author

ahmedsza commented Jul 26, 2023

I ended up setting Anaconda with notebook support and pointing it to that instance. that seem to work.

@olliescase
Copy link

Same issue on:
MacBook Pro M2 13" 2022 (MacOS 13.4.1 (c))

Ran setup for python using /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11

I have additionally tried installing manually this notebook package via pip to no success. Here is the log, sanitised:

... Ensuring /Users/{name}/Library/Jupyter/instances/{uuid} exists
... Ensuring /Users/{name}/Library/Jupyter/instances/{uuid}/config exists
... Ensuring /Users/{name}/Library/Jupyter/instances/{uuid}/data exists
... Ensuring /Users/{name}/Library/Jupyter/instances/{uuid}/config/custom exists
... Ensuring /Users/{name}/Library/Jupyter/kernels exists
... Starting Notebook server
    > "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/bin/python3" "/Applications/Azure Data Studio.app/Contents/Resources/app/extensions/notebook/resources/pythonScripts/startNotebook.py" --no-browser --ip=127.0.0.1  --no-mathjax --notebook-dir "/Users/{name}" --NotebookApp.token={token}

And this produces the following error:

Failed to change kernel. Kernel SQL will be used. Error was: Notebook process exited prematurely with error code: 1. StdErr Output: Traceback (most recent call last): File "/Applications/Azure Data Studio.app/Contents/Resources/app/extensions/notebook/resources/pythonScripts/startNotebook.py", line 1, in <module> import notebook.notebookapp ModuleNotFoundError: No module named 'notebook.notebookapp'

@kalo37
Copy link

kalo37 commented Jul 27, 2023

This is due to a change in module structure with jupyter notebook version 7. Downgrading the notebook version to 6.5 worked for me.

@olliescase
Copy link

This is due to a change in module structure with jupyter notebook version 7. Downgrading the notebook version to 6.5 worked for me.

Tested and can confirm this workaround works;

pip3 install notebook==6.5.5

At the very least, error handling should be introduced informing the user that their version is not supported. Preferably support for v7 will be implemented though.

@pw1z
Copy link

pw1z commented Aug 2, 2023

@kalo37 @olliescase
Thanks for posting that about stepping back. Very much appreciate it - pain in the rear for many of us out here but, newer versions sometimes have headaches for us all... I've seen this for many years.
For the others out there, when you install that older Jupyter notebook version, the 'newer' version will be uninstalled...

@olliescase
Copy link

@kalo37 @olliescase Thanks for posting that about stepping back.

No worries, I'll let @kalo37 take all the credit here for finding the cause of the problem 🙂

If someone wanted to take a stab at fixing this file:
https://github.com/microsoft/azuredatastudio/blob/main/extensions/notebook/resources/pythonScripts/startNotebook.py

I'm not exactly the most qualified when it comes to python. I think it should be as simple as changing notebook.notebookapp to just notebook.app but I haven't got the time or correct setup to test it at the moment.

@pw1z
Copy link

pw1z commented Aug 2, 2023

@olliescase
Not a problem, you still added value to @kalo37

I too, am not an expert and currently refreshing my python (& SQL) and jupyter knowledge.
Taking time from work to do 3 months hard-core studying, specifically for the GCP Data Engineering Pro & GCP Data Analytst certifications by end of this month and next month. So I can confidently put myself back into the market - leaving AWS Cloud Engineering behind.
GCP has quite the litany of materials to bone up on to become adept in, quite a lot... more than I bargained before starting my GCP journey...
And coming across errors like this (moduleNotFound), well, it just adds more research time - but it adds up knowledge-wise - especially when we come across input like kalo37's to help forge ahead.

@zueslast
Copy link

@olliescase DOOD...I FREAKING LOVE YOU...This fixed it.. I seriously was so mad and all the solutions online didnt work for me. I tried doing what you said and it worked.

For those who are curious, go to ur jupyter file, under scripts you will find jupyter-notebook-scripts.py. open it up and modify the code from notebook.notebookapp to notebook.app

@Abdelrahman-Elaraby
Copy link

@kalo37 @olliescase Thanks for posting that about stepping back.

No worries, I'll let @kalo37 take all the credit here for finding the cause of the problem 🙂

If someone wanted to take a stab at fixing this file: https://github.com/microsoft/azuredatastudio/blob/main/extensions/notebook/resources/pythonScripts/startNotebook.py

I'm not exactly the most qualified when it comes to python. I think it should be as simple as changing notebook.notebookapp to just notebook.app but I haven't got the time or correct setup to test it at the moment.

It worked with me too thanks!

@jehoppis
Copy link

jehoppis commented Nov 2, 2023

For anyone here that continued to have issues after downgrading the notebook version per @kalo37 and @olliescase , I used pip install notebook==6.5.5 and then had to use the comment by @Charles-Gagnon here to fix the issue. Also, I tried changing notebook.notebookapp to notebook.app per @olliescase but had to revert that before it worked.

@Prince-let
Copy link

@kalo37 @olliescase Thanks for posting that about stepping back.

No worries, I'll let @kalo37 take all the credit here for finding the cause of the problem 🙂

If someone wanted to take a stab at fixing this file: https://github.com/microsoft/azuredatastudio/blob/main/extensions/notebook/resources/pythonScripts/startNotebook.py

I'm not exactly the most qualified when it comes to python. I think it should be as simple as changing notebook.notebookapp to just notebook.app but I haven't got the time or correct setup to test it at the moment.

You saved my jupyter notebook! You are a genius!

@ansi5
Copy link

ansi5 commented Jan 8, 2024

I am using windos with anaconda

the error was like this :

ModuleNotFoundError: No module named 'notebook.notebookapp'

and this solved the problem:

conda update -n base -c defaults conda

@heytanay
Copy link

heytanay commented Jan 9, 2024

This is due to a change in module structure with jupyter notebook version 7. Downgrading the notebook version to 6.5 worked for me.

Tested and can confirm this workaround works;

pip3 install notebook==6.5.5

At the very least, error handling should be introduced informing the user that their version is not supported. Preferably support for v7 will be implemented though.

The issue was resolved as soon as i downgraded the version to 6.5.5 . Thank you so much.

@pm80
Copy link

pm80 commented Mar 24, 2024

This is due to a change in module structure with jupyter notebook version 7. Downgrading the notebook version to 6.5 worked for me.

Tested and can confirm this workaround works;

pip3 install notebook==6.5.5

At the very least, error handling should be introduced informing the user that their version is not supported. Preferably support for v7 will be implemented though.

notebook==6.5.5
traitlets==5.9.0
Django
django-extensions
jupyter

@pm80
Copy link

pm80 commented Mar 24, 2024

notebook==6.5.5
traitlets==5.9.0
Django
django-extensions
jupyter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests