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 'jupyter_server.contents' switching to Python kernel #24436

Closed
Charles-Gagnon opened this issue Sep 14, 2023 · 37 comments

Comments

@Charles-Gagnon
Copy link
Contributor

Started seeing this after the installing the 6.5.5 version of the notebook package for the python kernel. Unclear exactly what's causing it currently though.

While this issue was caused by switching to 6.5.5 (through the RC1 build) it also affects stable so seems to be something related to the packages themselves.

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\chgagnon\AppData\Roaming\Python\Python38\site-packages\notebook\traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
  File "C:\Users\chgagnon\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 2009, in _resolve_string
    return import_item(string)
  File "C:\Users\chgagnon\AppData\Roaming\Python\Python38\site-packages\traitlets\utils\importstring.py", line 30, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_server.contents'

Additional info:

  1. Here's the PR that introduced the line that's failing : Allow jupyter_server-based contents managers in notebook jupyter/notebook#5957
  2. Changing line 1411 in $(Python)\Python38\site-packages\notebook\notebookapp.py from

'jupyter_server.contents.services.managers.ContentsManager'

to

'jupyter_server.services.contents.manager.ContentsManager'

seems to fix the issue.

@Charles-Gagnon
Copy link
Contributor Author

Filed jupyter/notebook#7048

@Charles-Gagnon
Copy link
Contributor Author

#24443 will be used to track this

@anuragdogra2192
Copy link

The same issue with notebook 6.5.4

@Miguel-TX
Copy link

The Workaround:
    Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

@jeapenach
Copy link

thanks @Miguel-TX, that worked for me

@sauravmishra1710
Copy link

+1, @Miguel-TX that worked for me as well...

@KWagnerCS
Copy link

Thanks @Miguel-TX, it worked 👍

@Charles-Gagnon
Copy link
Contributor Author

For anyone else hitting this - we just released a new version of ADS which checks to make sure that traitlets package is 5.9.0. So if you update to the latest version then that should handle it for you.

@maxi-musz
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

Thanks man it worked

@markjpT markjpT mentioned this issue Sep 23, 2023
@REBECCANI
Copy link

Thank you @Miguel-TX. It worked

@Ctrl-Jay
Copy link

The Workaround: Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

Thanks @Miguel-TX this was very helpful

@Kushagra128
Copy link

thanks that works 🙏

@Apurva710555
Copy link

pip install traitlets==5.9.0

worked for me as well

@lollipop190
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.↳

lifesaver, genius!

@Wieso97
Copy link

Wieso97 commented Oct 7, 2023

You are my hero @Miguel-TX . Love from china

@benzi604
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

Thanks a lot!

@Addic021101
Copy link

Addic021101 commented Oct 18, 2023

pip install traitlets==5.9.0

broo you are good it worked for me too thanks man saved my day bro

@JuanPalomeque
Copy link

Thanks @Miguel-TX, It worked!

@Aashir-tech
Copy link

Thanks man , It worked

@Abhishek-Ramamurthy
Copy link

Thanks @Miguel-TX. It worked for me too!

@sebgobb
Copy link

sebgobb commented Nov 18, 2023

Thanks @Miguel-TX ! It worked too ! :)

@bandari-thiru
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

It works, awsome!!!

@RubTalha
Copy link

https://stackoverflow.com/a/77549554/13086128

@Amik-TJ
Copy link

Amik-TJ commented Nov 27, 2023

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

It worked. Thanks a lot

@SeeenyaOhar
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

Works perfectly!

@MartinUQ
Copy link

pip install traitlets==5.9.0

For me 5.8.0 did the job on macos

@Bhavil-Ahuja
Copy link

Thanks @Charles-Gagnon for the solution!

@henry3556108
Copy link

thx @Miguel-TX it work for me too

@WK-Shim
Copy link

WK-Shim commented Feb 8, 2024

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).
Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

Thanks man it worked

Thanks!! it worked very well

@White-Lucifer-002
Copy link

Thanks!! I had the same issue. It worked for me.

@Morten202
Copy link

Please anyone can help bc i have been battling with this for the past 3 days. It didn't open the camera at the module
(base) C:\Users\matek\avatarify-python>run_windows.bat
Traceback (most recent call last):
File "afy/cam_fomm.py", line 6, in
import requests
ModuleNotFoundError: No module named 'requests'

(avatarify) C:\Users\matek\avatarify-python>

@pm80
Copy link

pm80 commented Mar 24, 2024

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

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

@arturomoncadatorres
Copy link

pip uninstall traitlets
pip install traitlets==5.9.0

For the sake of completeness, this can also be done with conda:

conda install traitlets=5.9.0

(Note the use of a single = instead of ==)

Don't worry, this won't install two versions of traitlets. conda will perform the downgrade automatically.

@YizhouZ0v0
Copy link

The Workaround:     Uninstall the Recent Problematic Release (v5.10.0) and Install the Prior Version (v5.9.0).

Command Line:

pip uninstall traitlets
pip install traitlets==5.9.0

After I did this, I was finally able to open up my Jupyter Notebook (via Anaconda3) without the OP's error.

It worked for me. Thanks!!

@RubTalha
Copy link

RubTalha commented May 5, 2024

@hlnull
Copy link

hlnull commented Oct 8, 2024

https://stackoverflow.com/a/77549554/13086128

Tried pip install traitlets==5.9.0 and met the following error:

ipython 8.27.0 requires traitlets>=5.13.0, but you have traitlets 5.9.0 which is incompatible.

Upgrade the notebook helps.

pip install --upgrade --no-cache-dir notebook==6.*

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