Jupyter Notebook not Working in Pycharm


I'm trying to run Jupyter Notebooks on PyCharm Professional 2020.2.

When I open a ipynb file, PyCharm starts a managed Server with the following configuration:

But in the Toolbar the drop down menu only has "Python 3" as an interpreter to choose from, and not the project default. When I execute a code cell I get the following warning:

When I click on "Register project interpreter as kernel, I get the following error pop up and traceback:


Traceback (most recent call last):
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\runpy.py", line 109, in _get_module_details
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\kutsch\Miniconda3\envs\TFinPractice\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

Process finished with exit code 1


The German text next to the ImportError says that the Module was not found. Even so, the Jupyter toolbar interpreter drop down menu now shows the project default interpreter, but when I try to execute a cell I get the following warning text:





Hmm, seems like the issue has been reported previously: https://youtrack.jetbrains.com/issue/PY-39047

Please try to delete and recreate the project interpreter from scratch, reinstall Jupyter, and try again.


I got the exact problem with Pycharm 2021.1.2, Build #PY-211.7442.45.


Pycharm 2022.2 Pro - notebook files would not load as a Jupyter notebook until I added *.ipynb as a file name pattern to the "Jupyter Notebook" file type. Easy fix but just thought I add this as the title of this post covers this, but with different underlying symptoms & root cause. Hope it helps someone else.

when *.ipynb assigned to JSON filetype, this error message results:

SEVERE - #c.i.o.a.i.FlushQueue - class com.intellij.json.psi.impl.JsonFileImpl cannot be cast to class org.jetbrains.plugins.notebooks.jupyter.psi.JupyterFile (com.intellij.json.psi.impl.JsonFileImpl is in unnamed module of loader com.intellij.util.lang.PathClassLoader @6aceb1a5; org.jetbrains.plugins.notebooks.jupyter.psi.JupyterFile is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4095057c)


PS: If I access the Jupyter Server that I started in PyCharm in the browser, then everything works fine.


There should be a message "Register project kernel", have you tried clicking "Register"? 


Andrey Resler do you mean "Register project interpreter as kernel" like in the second image?


I am facing the same issue in PyCharm 2021.2 Build #PY-212.4535.11


Hello @Pallavlearn and Giang Le


Could you please run:

jupyter notebook


 in the terminal (out PyCharm)? Will you get the same error? Please see the https://github.com/jupyter/notebook/issues/4909




Hello I have exactly the same problem.
When typing jupyter notebook in the terminal inside Pycharm I get the error:

ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\sam24\.conda\envs\pytorch_ml\lib\site-packages\zmq\backend\cython\__init__.py)

To run jupyter notebook in the terminal I have to first activate the conda environment.


Please sign in to leave a comment.