How to Fix "Importerror: Dll Load Failed" While Importing Win32Api

How to fix ImportError: DLL load failed while importing win32api

Run Scripts\pywin32_postinstall.py -install in an Admin command prompt

ref: https://github.com/mhammond/pywin32/issues/1431

edit: User @JoyfulPanda gave a warning:

Running this script with admin rights will also copy pythoncom37.dll, pywintypes37.dll (corresponding to the pywin32 version), into C:\WINDOWS\system32, which effectively overwrites the corresponding DLL versions from Anaconda already there. This later causes problem when openning (on Windows) "Start Menu > Anaconda3 (64-bit) > Anaconda Prompt (a_virtual_env_name)". At least Anaconda 2019.07 has pywin32 223 installed by default. Pywin32 224 may work, but 225-228 causes problem for Anaconda (2019.07)

how to fix import win32api # noqa: E402 ImportError: DLL load failed while importing win32api: %1 is not a valid

This is can be due to different bit versions of applications you are using here

refer:https://www.youtube.com/watch?v=fGuHMVAruAE

so better to check the bit versions

ImportError: DLL load failed while importing shell

I finally managed to get Anaconda to start working by executing the line:

pip install pywin32==300

I had to do it twice, because the first time it went for 301, not 300. The second time then dropped it to 300. This was from the Anaconda for Windows installer downloaded just two days ago from the Anaconda website and doing a "clean install"!

What a fiasco!

Until that point, NOTHING really worked. Almost every important command within Anaconda would fail with the Win32com error, and Navigator would not even start. Apparently the latest version of pywin32 is 304, but it doesn't work either. Is anyone looking into this? For a newbie like me, this is a very bad look for Anaconda as a tool! I was on the brink of simply giving up when I literally stumbled onto this thread.

Note that it has been MONTHS between my post and the one before mine. I'd say that this has probably caused a lot of people to simply give up (assuming that there are many who actually try to install this on Windows per month, that is).

import win32api error in Python 2.6

After I copy pywintypes26.dll and pythoncom26.dll from C:\Python26\Lib\site-packages\pywin32_system32 to C:\Python26\Lib\site-packages\win32 -> Solve the problem!



Related Topics



Leave a reply



Submit