Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DLL error importing win32api on windows 10

I have python 2.7.2 on windows 10. When I load win32api and wmi it fails to load. The python install on windows 10 is same as on another windows 7 PC. I don't have this issue on win 7. Below are the errors I get when I try to import the above modules on windows 10.

>>> import win32api
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.


>>> import wmi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\site-packages\wmi.py", line 88, in <module>
    from win32com.client import GetObject, Dispatch
  File "c:\Python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.

What could be the cause for my issue? Is there a minimum python version that is supposed to be used with windows 10?

like image 355
user3885927 Avatar asked Jan 05 '15 18:01

user3885927


People also ask

What does DLL load failed mean?

The ImportError: DLL load failed: The specified module could not be found message appears when there's an issue with your DLL files. In order to fix issues with system files you can use the SFC scan.


1 Answers

I can't reproduce this now, but I'll take a shot, as I had a similar problem some time ago and was able to resolve it by this solution: import win32api error in Python 2.6

I Basically copied pythoncom27.dll and pywintypes27.dll from Python27/Lib/site-packages/pywin32_system32 to Python27/Lib/site-packages/win32 ... Or something to that effect.

Sorry for the vagueness - but it helped me (found the link in my bookmarks).

Hope it helps!

like image 91
jaqHollow Avatar answered Oct 06 '22 20:10

jaqHollow