错误代码
ImportError: DLL load failed while importing win32api: 找不到指定的程序。
报错提示
(Just_do_it) C:\Users\14116>jupyter lab
[I 2021-09-13 10:42:13.972 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-09-13 10:42:13.998 ServerApp] The 'min_open_files_limit' trait of a ServerApp instance expected an int, not the NoneType None.
[I 2021-09-13 10:42:14.499 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-09-13 10:42:14.501 LabApp] JupyterLab extension loaded from d:\anaconda3\envs\just_do_it\lib\site-packages\jupyterlab
[I 2021-09-13 10:42:14.501 LabApp] JupyterLab application directory is D:\anaconda3\envs\Just_do_it\share\jupyter\lab
[I 2021-09-13 10:42:14.505 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-09-13 10:42:14.507 ServerApp] Serving notebooks from local directory: C:\Users\14116
[I 2021-09-13 10:42:14.507 ServerApp] Jupyter Server 1.11.0 is running at:
[I 2021-09-13 10:42:14.507 ServerApp] http://localhost:8888/lab?token=4937b82c20db288e9914b9642e899c8bdeee51068f99713a
[I 2021-09-13 10:42:14.508 ServerApp] or http://127.0.0.1:8888/lab?token=4937b82c20db288e9914b9642e899c8bdeee51068f99713a
[I 2021-09-13 10:42:14.508 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Traceback (most recent call last):
File "d:\anaconda3\envs\just_do_it\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\anaconda3\envs\just_do_it\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\anaconda3\envs\Just_do_it\Scripts\jupyter-lab.EXE\__main__.py", line 7, in <module>
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_server\extension\application.py", line 577, in launch_instance
serverapp.start()
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_server\serverapp.py", line 2662, in start
self.start_app()
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_server\serverapp.py", line 2592, in start_app
self.write_server_info_file()
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_server\serverapp.py", line 2410, in write_server_info_file
with secure_write(self.info_file) as f:
File "d:\anaconda3\envs\just_do_it\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_core\paths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "d:\anaconda3\envs\just_do_it\lib\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: 找不到指定的程序。
解决方法
-
卸载掉原来的pywin32
pip uninstall pywin32
-
安装新的pywin32
pip install pywin32==225