13

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?

Julio Cezar Silva
  • 2,148
  • 1
  • 21
  • 30
user3885927
  • 3,363
  • 2
  • 22
  • 42
  • 1
    I would suspect that `pywin32` has not been updated for the Win10 APIs... – MattDMo Jan 05 '15 at 19:02
  • I'm using Windows 10 and here works fine. – alex Aug 23 '15 at 00:25
  • You need to be careful when downloading the library when the system 32 or 64 bits. – alex Aug 23 '15 at 00:27
  • Did you find out more, or how did you solve it? Thanks – Weslor Aug 25 '15 at 20:51
  • Might want to update; 2.7.2 is massively out of date; the 2.7.y line has had more feature and fix work than any other minor in the 2.x line. Moving to 2.7.11 may solve more problems than you think. – ShadowRanger Jan 30 '16 at 06:38
  • 1
    Possible duplicate of [import win32api error in Python 2.6](https://stackoverflow.com/questions/7238403/import-win32api-error-in-python-2-6) –  Jun 27 '18 at 00:39

2 Answers2

1

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!

Community
  • 1
  • 1
jaqHollow
  • 84
  • 5
-1

try reinstalling, the error seems to say that your modules aren't being found so there are probably a few files that didnt download properly. since they can't find the modules, its probably the libs folder that has all the modules that come with pywin32

R Nar
  • 5,465
  • 1
  • 16
  • 32