DLL load failed on Python 3.4b1
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
I've installed pywin32 218 for amd64, but after installing, import win32com yields:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python\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.
This is on Python 3.4b1 64-bit. I suspect this is simply an API incompatibility with the early-compiled release for 3.4. Is a new release required, or is the current 218 release expected to work with 3.4b1?
Digging into the issue a bit, I inspected the .pyd file with Dependency Walker and found that it's unable to load pywintypes34.dll. I see that file is installed at $Lib/site-packages/pywin32_system32.
Doing a search around, it appears the issue is that the post install isn't being invoked. Perhaps I'm not invoking the installer with the proper privileges.
I ran the installer using "Run as Administrator" from Windows explorer, and it seemed to install just fine this time. Sorry for the noise.
The problem has re-emerged, apparently spontaneously. I uninstalled and re-installed (again using Run as Administrator), and the problem persists.
I was able to work around the issue by running pywin32_postinstall.py -install; I won't be surprised if the issue arises again. I'm using Windows 8.1. Perhaps it has some protections against installing files to System32?
I just ran into the same issue using the just officially released python 3.4.0 64 bit version. I am also using Windows 8.1 64 bit. The workaround by J. Coombs also worked for me. Other than that I had to revert to python 3.3.5 with the pywin32 3.3 extensions to use win32com; I don't have the python working skills to add much more information than a confirmation of the problem.
In case it's relevant, with a non-official installer (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32 ), I had this symptom on Windows 7 x64 using Python 3.4.0 32 bit:
I tried running the installer using "Run as administrator" didn't help. I finally just copied the files:
Last edit: echion 2014-03-18
I have the same problem with the win32 official build for 3.4.0 on Windows 7 64 bit. Installing pywin32 as administrator did not solve it, but running pywin32_postinstall.py -install as suggested did.
EDIT: Accidentally left this comment on the wrong page... sorry
Last edit: flutefreak7 2014-09-16