Kernel Error: Failed to start - ImportError: DLL load failed while importing win32api

I did a decent amount of searching before posting, and I can’t seem to find anyone with the same exact problem, or at least a similar problem with a solution that works for me.

My Kernel is failing to start. I’m getting this error:
ImportError: DLL load failed while importing win32api: %1 is not a valid Win32 application.

These are all of my version numbers:
jupyter core : 4.6.3
jupyter-notebook : 6.0.3
qtconsole : 4.7.3
ipython : 7.14.0
ipykernel : 5.2.1
jupyter client : 6.1.3
jupyter lab : 2.1.1
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.6
traitlets : 4.3.3

And Python 3.8.2.

I’m on windows 10, and have try running Jupyter Notebook from cmd, and also the powershell in VS Code with the same results.

Thank you

@jroo I am also facing the same issue. Did you get it solved?

1 Like

Try and reinstall pywin32

Worked for me

1 Like

hey I get the same error but installing pywin32 does not works for me , any other suggestions regarding the same!!

a pro tip , and thanks i’m able to resolve this as , just by uninstalling pywin32 and install again!!!

1 Like

@Sabarish_S nope. Nothing I see online resolves this issue.

I’m just now returning to it and trying to fix it again with no results.

This worked you just have to reinstall pywin32

The solution is to provide the python interpreter with the path-to-your-module. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys

This isn’t a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../ #each path must be separated by a colon