Jupyter notebook launch error solution on Anaconda Navigator
- datasoyoung
- Oct 11, 2023
- 2 min read
Updated: Oct 16, 2023
I wrestled with a perplexing error message for two whole days. Despite diligently exploring advice from Google, various YouTubers, and even seeking recommendations from ChatGPT, I remained unsuccessful in resolving the issue. My problem still loomed unsolved.
However, a breakthrough came when I discovered an alternative method to access Jupyter. I accomplished this by creating a new environment and installing Jupyter within it. This shift eliminated the pesky error message that had been blocking my path to Jupyter through Anaconda. I share this experience in the hope that it might assist others who find themselves struggling to open Jupyter.
This is the error message popping up when I click Launch button for jupyter notebook.

The error message is as follows:
Please open this for the error message contents:
Traceback (most recent call last): File "C:\Users\soyou\anaconda3\Lib\site-packages\notebook\traittypes.py", line 235, in _resolve_classes klass = self._resolve_string(klass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\traitlets.py", line 2025, in _resolve_string return import_item(string) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\utils\importstring.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:\Users\soyou\anaconda3\Scripts\jupyter-notebook-script.py", line 10, in sys.exit(main()) ^^^^^^ File "C:\Users\soyou\AppData\Roaming\Python\Python311\site-packages\jupyter_core\application.py", line 282, in launch_instance super().launch_instance(argv=argv, **kwargs) File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\config\application.py", line 1051, in launch_instance app = cls.instance(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\config\configurable.py", line 575, in instance inst = cls(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\traitlets.py", line 1311, in __new__ inst.setup_instance(*args, **kwargs) File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\traitlets.py", line 1354, in setup_instance super(HasTraits, self).setup_instance(*args, **kwargs) File "C:\Users\soyou\anaconda3\Lib\site-packages\traitlets\traitlets.py", line 1330, in setup_instance init(self) File "C:\Users\soyou\anaconda3\Lib\site-packages\notebook\traittypes.py", line 226, in instance_init self._resolve_classes() File "C:\Users\soyou\anaconda3\Lib\site-packages\notebook\traittypes.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'
How I solved this problem
Step 1. Create a New Environment.
Open Anaconda Prompt In your window search tab, write "anaconda prompt" and click it to open. You can create a new environment using the following command:

Replace 'myenv' with the desired environment name.
Step 2. Activate the environment using:

Step 3. Install Jupyter
To install Jupyter using conda, use the following command:

Step 4. Check if the new environment created in Anaconda Navigator and click the green play button next to your environment name.

Step 5. Open Jupyter Notebook
If you see "Open with Jupyter Notebook", you can simply click it. Then your Jupyter Notebook browser will be open.
If you don't see the option above, follow this step.
Click "Open Terminal" and type the following command:

Step 6. Enjoy and keep working on with this beautiful web-based Jupyter Notebook interface in your default web browser.

Additional guide when you use libraries such as pandas
Since you are working in the new environment, you have to install additional libraries such as pandas and scikit-learn.
Step 1. open anaconda prompt and activate your new environment that you created above. (If you skip this part, it won't work since you're installing it in original environment which is probably in root.)

Step 2. Install the library.
In my case, I installed pandas(blue marker on the picture) and scikit-learn(second picture)


Comments