5
votes

While opening Jupyter notebook or Spyder, I am continuously getting 'kernel error' notification.

Tried to reinstall anaconda3, ipython, kernel but the issue stays. I had downloaded Python 3.7 in Windows 10 system.

I am getting the below error in log.

"> Traceback (most recent call last): File "> "C:\Users\AppData\Local\Continuum\anaconda3\lib\site‑packages\spyder\plugins\ipytho"nconsole.py",

line 1572, in create_kernel_manager_and_kernel_client kernel_manager.start_kernel(stderr=stderr_handle) File "C:\Users\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\manager.py", line 240, in start_kernel self.write_connection_file() File "C:\Users\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 476, in write_connection_file kernel_name=self.kernel_name File "C:\Users\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 141, in write_connection_file with secure_write(fname) as f: File "C:\Users\AppData\Local\Continuum\anaconda3\lib\contextlib.py", line 112, in enter return next(self.gen) File "C:\Users\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 404, in secure_write win32_restrict_file_to_user(fname) File "C:\Users\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 359, in win32_restrict_file_to_user import win32api ImportError: DLL load failed: The specified procedure could not be found.

7
win32_restrict_file_to_user import win32api ImportError: DLL load failed: The specified procedure could not be found. --> seems your problem is Windows. Also try to run it as admin - Leos313
Thanks Leos313. The problem has been resolved by downgrading the pywin32.Required to run this- pip install --upgrade pywin32==224 - Santanu Basu

7 Answers

5
votes

Its basically system compatible issues with python/Jupiter.

Please locate the file pywin32_postinstall.py in your python installed path

Example

C:\Users\AppData\Local\Programs\Python\Python38-32\Scripts>

And navigate to the path and run the file/command pywin32_postinstall.py -install

1
votes

pip install pywin32 -U

Should do the trick

1
votes

After longer looking here and there I found this question but none of answers helped me, after all I have noticed the correct solution in comments, so I add it here as answer for future readers that might not check the comments at first like me.

Downgrading pywin32 to version 224 is the way:

pip install --upgrade pywin32==224 
0
votes

Copying the win32api file from the ..//site-packages/win32 folder to the ..//site-packages//jupyter_core folder finally did the trick for me.

0
votes

Follow this to resolve the issue when a kernel is dead.

pip install --upgrade pywin32==224 (downgrade the pywin32 from 225 to 224) or pip install --upgrade pywin32==224 --user

If the above still not work and one prompt appears that pythoncom37.dll should not be the path 'C:\Windows\System32' then remove the 'pythoncom37.dll' from 'C:\Windows\System32'.

0
votes

I started all over:

  • I uninstalled notebook.

  • I uninstalled python 3.7.9.

  • I then reinstalled python 3.8.4 and.

  • reinstalled notebook.

Problem solved!

0
votes

If you are working in a miniconda on conda environment. You could just install pywin32 using conda instead of pip.

This solved my problem

conda install pywin32