Can't open jupyter notebook at all

Question:

Last weeks everything was ok. But all of a sudden I can’t run jupyter notebook (if i run it from the start menu it wont open / if i run it from anaconda navigator or dataspell it wont run and give me the following error:

Jupyter server process exited with code 1 Traceback (most recent call
last): File
"C:UsersSOL-1anaconda3Libsite-packagesnotebooktraittypes.py",
line 235, in _resolve_classes klass = self._resolve_string(klass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^ File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletstraitlets.py",
line 2028, in _resolve_string return import_item(string)
^^^^^^^^^^^^^^^^^^^ File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletsutilsimportstring.py",
line 31, in import_item module = import(package, fromlist=[obj])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module
named ‘jupyter_server.contents’ During handling of the above
exception, another exception occurred: Traceback (most recent call
last): File
"C:UsersSOL-1anaconda3Scriptsjupyter-notebook-script.py", line
10, in sys.exit(main()) ^^^^^^ File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagesjupyter_coreapplication.py",
line 280, in launch_instance super().launch_instance(argv=argv,
**kwargs) File "C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletsconfigapplication.py",
line 1051, in launch_instance app = cls.instance(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^ File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletsconfigconfigurable.py",
line 581, in instance inst = cls(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^
File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletstraitlets.py",
line 1313, in new inst.setup_instance(*args, **kwargs) File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletstraitlets.py",
line 1356, in setup_instance super(HasTraits,
self).setup_instance(*args, **kwargs) File
"C:UsersSOL-1AppDataRoamingPythonPython311site-packagestraitletstraitlets.py",
line 1332, in setup_instance init(self) File
"C:UsersSOL-1anaconda3Libsite-packagesnotebooktraittypes.py",
line 226, in instance_init self._resolve_classes() File
"C:UsersSOL-1anaconda3Libsite-packagesnotebooktraittypes.py",
line 238, in _resolve_classes warn(f"{klass} is not importable. Is it
installed?", ImportWarning) TypeError: warn() missing 1 required
keyword-only argument: ‘stacklevel’ )

Screenshot of the error when I try to run a simple code:

I reinstalled anaconda navigator (anaconda3), jupyter notebook, python.
It doesnt work.
Last weeks when it worked I just opened jupyter notebook from the start menu and then it opened in my browser as a localhost (it worked fine).
If I try to do that now it just opens a cmd window and it shows a big text but closes very quickly as I cant see the text in it.
I am currently enrolled in IBM Data Science Professional Certificate and I’m trying to use it like I used it in the previous courses but now it won’t work.

Asked By: zexat

||

Answers:

Looks like you may be dealing with an error similar to this Github issue post: https://github.com/microsoft/azuredatastudio/issues/24436. Looks like the solution solved the error for multiple people.

Hope that helps

Answered By: ah529

I got this error too. The solution is to update jupyter to the latest version (7.0.x).

Do:

conda update notebook
Answered By: neal301