azuredatastudio: ModuleNotFoundError: No module named 'jupyter_server.contents' switching to Python kernel

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 : https://github.com/jupyter/notebook/pull/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.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 18
  • Comments: 35 (3 by maintainers)

Most upvoted comments

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.

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

pip install traitlets==5.9.0

For me 5.8.0 did the job on macos

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

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!

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.