importing from .pyd

M

moijes12

hi

there is a .pyd file present in the same folder as the script abc.py
by the name foo.pyd .I don't have foo.py .In the script abc.py I try

import foo

Error i get is
ImportError: DLL load failed: The specified module could not be found.

I have tried placing .pyd under C:\python25\DLLs but it didn't work.I
have also given the path for foo.pyd in PYTHONPATH.but i still recieve
the same error.

Please suggest a solution

moijes12
 
K

Kay Schluehr

hi

there is a .pyd file present in the same folder as the script abc.py
by the name foo.pyd .I don't have foo.py .In the script abc.py I try

import foo

Error i get is
ImportError: DLL load failed: The specified module could not be found.

It looks like the module that was accessed is either corrupt
( unavailable entry point ) or it contains dependencies to other
modules which are not available.

At least the latter can be checked without access to the source using
the DependencyWalker:

http://www.dependencywalker.com/

Notice that the message clearly indicates that Python found the module
but failed to load it i.e. performing a LoadLibrary() which yielded a
NULL pointer.
 
M

moijes12

It looks like the module that was accessed is either corrupt
( unavailable entry point ) or it contains dependencies to other
modules which are not available.

At least the latter can be checked without access to the source using
the DependencyWalker:

http://www.dependencywalker.com/

Notice that the message clearly indicates that Python found the module
but failed to load it i.e. performing a LoadLibrary() which yielded a
NULL pointer.

thanks
 
J

John Machin

Notice that the message clearly indicates that Python found the module
but failed to load it i.e. performing a LoadLibrary() which yielded a
NULL pointer.

"The specified module could not be found" clearly indicates that
"Python found the module"???

I suggest a more descriptive and (Monty) Pythonic error message: "I
found a foo.pyd which looks like a DLL but it contains no 'initfoo'
entrypoint therefore I throw an ImportError and a bucketful of pig
slops in your general direction."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top