Why is this pyd file not imported to some computers?

My python project has a C ++ component that compiles and distributes as a .pyd file inside a Python egg. I noticed that this seems incompatible only with some of our brand new 64-bit Windows servers. We have 4 (presumably) equally prepared machines - each of them runs a 64-bit version of the Windows 2003 server, but 2 of these machines do not allow me to call functions in an egg.

After some experimentation, I was able to find a recipe for creating a reproducible error . The problem occurs when Python tries to import the pyd file.

I copied pyd to a temporary folder and ran Python.exe from this place, by the way, we are still using the 32-bit version of Python 2.4.4, since none of our libraries have yet been ported to the 64-bit architecture. Then I try to import my module (called pyccalyon). The first time I try this, I get an error message:

"ImportError: DLL load failed: The specified module could not be found" 

The next time I try this, the python interpreter will fail: no stacktrace at all!

Naturally, you suspect my PYD - the strange thing about this is that it is already used on thousands of computers and 10 other servers, many of which are identical to 64-bit machines. The project is constantly tested both in development and after release, therefore, if this thing was so unstable that we would have known about this for a very long time. This component is considered stable code, so it is surprising that it breaks so spectacularly.

Any suggestions on what I can do to debug this complex library? Crazy ideas are welcome at this point, because we have exhausted all reasonable ones.

Thanks!

Update 0 . Good with a process monitor. I was able to compare one 64-bit server that does not work with another, which works fine. I found that the failure seems to be due to the lack of a DLL, SysWOW64 / mscoreee.dll - any idea what this component is and where can I get it? I can take this back to our IT staff who can fix things.

+7
python windows
source share
5 answers

You can try something like Process Monitor to see which DLL files it is trying to load. I would suggest that one of the other DLLs it relies on cannot be found.

Edit: It looks like you already managed to get some useful information, but I’ll clarify how you can reduce the flow of information that procmon produces.

Use the filter function to specify the command line (in this case, you must have python on the command line). This will only show you messages from the process you are interested in. You can then filter out all the search results so that you can see which DLL it is looking for.

Obviously, there are many other things that you can filter, but that is how I got results in the past. This is a really handy tool for developing what happens in such situations.

(Tools like depend or DependencyWalker are also useful for determining which DLLs are used - they give static information, while procmon will show you a dynamic look. Both of them can be useful.)

+4
source share

Have you tried to check which DLL files are associated with PYD links? You can do this, for example, using Dependency Walker or VS depends.exe.

+4
source share

According to the Microsoft Knowledge Base , mscoree.dll is part of the .NET Framework. To be precise, this is the Microsoft.NET Runtime Execution Engine.

By doing so, you could (re) install the .NET Framework.

+2
source share

Maybe you are missing C ++ dlls runtime / standard-library on machines where it doesn't work, and the module is trying to use them?

+1
source share

I had the same problem and depend.exe showed me that foo.pyd was created with python25.lib instead of python27.lib . Therefore, he could not find python25.dll .

0
source share

All Articles