Python – *.pyd file fails to load, but DependancyWalker comes up clean, and ProcMon shows it loaded


I am trying to load a *.pyd with Python, but I receive the well known "Import Error: DLL load failed: the specified procedure can not be found." error.

I have already done the following:

1.) Investigated the *.pyd with Dependency Walker. GPSVC.DLL and IESHIMS.DLL came up as missing, but delay loaded, IEFRAME.DLL aslo came up as missing an export, but was also delay-loaded. It's my understanding that these are not used, and are delay load anyway, so they should not be the problem.

2.) Did an "import foo" on foo.pyd in the python command window, with ProcMon watching. ProcMon shows event "LoadImage" on "foo.pyd" with result SUCCESS.

This seems to imply that the *.pyd file loaded correctly.

So what am I missing. My windows diagnostics are telling me all is well, but python is telling me the thing cannot be loaded (usually due to a missing dll or symbol).



Best Solution

Is the .pyd file for the same version of Python you're using? Loading a .pyd file for the wrong Python version can produce that error message.

Dependency Walker can show you which pythonNN.dll it links to.

Related Question