Home > Enterprise >  An error ocurred while starting the kernel in spyder
An error ocurred while starting the kernel in spyder

Time:04-10

I ran these two pip codes: --user pip install azureml-explain-model and --user pip install azureml-interpret in the anaconda command prompt and then this error showed up. The error is:

Traceback (most recent call last):
File "C:\Users\risha\anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole\plugin.py", line 1568, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle,
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_client\manager.py", line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_client\manager.py", line 286, in pre_start_kernel
self.write_connection_file()
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_client\connect.py", line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_client\connect.py", line 136, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\risha\anaconda3\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_core\paths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\risha\anaconda3\lib\site‑packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: The specified procedure could not be found.

Help me, please!!

CodePudding user response:

To resolve this import win32api ImportError: DLL load failed while importing win32api: The specified procedure could not be found. error, try following ways:

  1. If you are using Python 3.8, upgrade pywin32 using pip:
pip install --upgrade pywin32==225

OR

  1. Install pywin32 using conda:
conda install pywin32 

Afer installing pywin32, make sure to run post installation script at specific Python location:

python [environment path]/Scripts/pywin32_postinstall.py -install

References: Getting kernel error while trying to open Jupyter notebook or Spyder, How to fix "ImportError: DLL load failed" while importing win32api and Kernel error win32api

  • Related