我在anaconda命令提示符下运行了这两个pip代码:--user pip install azureml-explain-model
和--user pip install azureml-interpret
,然后出现了这个错误。错误为:
Traceback (most recent call last):
File "C:Usersrishaanaconda3libsite‑packagesspyderpluginsipythonconsoleplugin.py", line 1568, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle,
File "C:Usersrishaanaconda3libsite‑packagesjupyter_clientmanager.py", line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:Usersrishaanaconda3libsite‑packagesjupyter_clientmanager.py", line 286, in pre_start_kernel
self.write_connection_file()
File "C:Usersrishaanaconda3libsite‑packagesjupyter_clientconnect.py", line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "C:Usersrishaanaconda3libsite‑packagesjupyter_clientconnect.py", line 136, in write_connection_file
with secure_write(fname) as f:
File "C:Usersrishaanaconda3libcontextlib.py", line 113, in __enter__
return next(self.gen)
File "C:Usersrishaanaconda3libsite‑packagesjupyter_corepaths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "C:Usersrishaanaconda3libsite‑packagesjupyter_corepaths.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.
请帮帮我!!
要解决此import win32api ImportError: DLL load failed while importing win32api: The specified procedure could not be found.
错误,请尝试以下方法:
- 如果使用
Python 3.8
,请使用pip
升级pywin32
:
pip install --upgrade pywin32==225
或
- 使用
conda
安装pywin32
:
conda install pywin32
安装pywin32
后,请确保在特定的Python位置运行安装后脚本:
python [environment path]/Scripts/pywin32_postinstall.py -install
参考文献:试图打开Jupyter笔记本或Spyder时出现内核错误,如何修复";ImportError:DLL加载失败";导入win32api和内核错误win32api 时