ImportError:DLL加载失败:%1不是有效的Win32应用程序-jupyter笔记本上的内核错误



我在jupyter笔记本电脑上遇到以下内核错误。这个问题是在安装了新版本的python(3.8.2(和visualstudiopython包之后开始的。我试过卸载和重新安装anaconda,但它仍然不起作用。

Traceback (most recent call last):
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadoweb.py", line 1703, in _execute
result = await result
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesnotebookservicessessionshandlers.py", line 72, in post
type=mtype))
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 735, in run
value = future.result()
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesnotebookservicessessionssessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 735, in run
value = future.result()
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesnotebookservicessessionssessionmanager.py", line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 735, in run
value = future.result()
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagestornadogen.py", line 209, in wrapper
yielded = next(result)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesnotebookserviceskernelskernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_clientmultikernelmanager.py", line 158, in start_kernel
km.start_kernel(**kwargs)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_clientmanager.py", line 301, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_clientmanager.py", line 248, in pre_start_kernel
self.write_connection_file()
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_clientconnect.py", line 474, in write_connection_file
kernel_name=self.kernel_name
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_clientconnect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "C:ProgramDataAnaconda3libcontextlib.py", line 112, in __enter__
return next(self.gen)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_corepaths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:UsersTolgaAppDataRoamingPythonPython37site-packagesjupyter_corepaths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application.

我已经解决了执行以下代码的问题:pip install -- pywin32==227

最新更新