Tempelier90
Tempelier90

Reputation: 31

ImportError: DLL load failed: %1 is not a valid Win32 application - kernel error at jupyter notebook

I am experiencing the following kernel error at jupyter notebook. This problem has started after having installed new version of python(3.8.2) and visual studio python package. I have tried to uninstall and reinstall anaconda but it isn't still working.

 Traceback (most recent call last):
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1703, in _execute
    result = await result
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_client\multikernelmanager.py", line 158, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 301, in start_kernel
    kernel_cmd, kw = self.pre_start_kernel(**kw)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 248, in pre_start_kernel
    self.write_connection_file()
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 474, in write_connection_file
    kernel_name=self.kernel_name
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 138, in write_connection_file
    with secure_write(fname) as f:
  File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_core\paths.py", line 435, in secure_write
    win32_restrict_file_to_user(fname)
  File "C:\Users\Tolga\AppData\Roaming\Python\Python37\site-packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
    import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application.

Upvotes: 0

Views: 5083

Answers (1)

Tempelier90
Tempelier90

Reputation: 31

I have solved the problem with executing the following code: pip install -- pywin32==227

Upvotes: 2

Related Questions