Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting kernel error while trying to open Jupyter notebook or Spyder

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.

like image 715
Santanu Basu Avatar asked Oct 11 '19 12:10

Santanu Basu


People also ask

Why is my Jupyter notebook not launching?

Jupyter fails to start If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command jupyter notebook . If it can't find jupyter , you may need to configure your PATH environment variable.

How does Spyder connect to kernel?

Click Connect to an existing kernel from the Console menu or the IPython Console pane's “Gear” menu. Browse for or enter the path to the connection file from the previous step. If you're connecting to a local kernel, click Ok and Spyder should connect to the kernel; if a remote kernel, proceed to the final step.

How do you reset a Jupyter notebook to resolve kernel crashes?

You can restart your Jupyter Kernel by simply clicking Kernel > Restart from the Jupyter menu. Note: This will reset your notebook and remove all variables or methods you've defined! Sometimes you'll notice that your notebook is still hanging after you've restart the kernel.


2 Answers

pip install pywin32 -U

Should do the trick

like image 26
Ohad Zadok Avatar answered Nov 14 '22 22:11

Ohad Zadok


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

like image 143
Saimanohar Upputuri Avatar answered Nov 14 '22 22:11

Saimanohar Upputuri