DLL load failed: The specified procedure could not be found

John Machin sjmachin at lexicon.net
Wed Jun 1 01:31:28 CEST 2005

Bill Davy wrote:
> sys.path:
>  H:\Husky\HostPC\V1\SHIP\Debug
>  H:\Husky\HostPC\V1\SHIP
>  E:\Bill\Python-2.4.1\PCbuild\python24_d.zip
>  C:\Python24\Lib
>  C:\Python24\DLLs
>  C:\Python24\Lib\lib-tk
>  H:\Husky\HostPC\V1\RunSHIP
>  H:\Husky\HostPC\V1\Debug
>  C:\Python24
>  C:\Python24\lib\site-packages
> Traceback (most recent call last):
>   File "H:\Husky\HostPC\V1\SHIP\test1.py", line 7, in ?
>     import SHIP
>   File "H:\Husky\HostPC\V1\Debug\SHIP.py", line 5, in ?
>     import _SHIP
> ImportError: DLL load failed: The specified procedure could not be found.
> a) What "specified procedure "
> b) SHIP was made by SWIG

and so presumably was _SHIP ... therefore it appears that you might be 
better off asking for help on the SWIG mailing list.

> c) Is there some way to find out which DLL and which procedure is involved?

One would expect given the reported context (import _SHIP) that it has 
found (somewhere!) a DLL called "_SHIP.pyd" and is looking in it 
(unsuccessfully) for an entrypoint called "init_SHIP".

The usual suspect here would be the C (or C++) compiler messing with the 
name of the entrypoint; possible messes include underscores at the front 
and/or frame size at the end e.g. "_initfoo at 12" instead of just 
"initfoo". Possibly you are using a C[++] compiler that's not the one 
that SWIG thinks you are using.

But exactly which DLL? Given your "interesting" sys.path, it might be an 
idea to run python with the -v argument, so you can see where all your 
imports are resolved.

Once you have worked out which _SHIP.pyd is the cause, you can inspect 
it and determine what entrypoint(s) it has.


More information about the Python-list mailing list