Can't load .pyd files from embedded Python interp

Gordon McMillan gmcm at hypernet.com
Sun Jul 16 21:11:19 EDT 2000


Edward K. Ream wrote:

>I'm having difficulty importing modules defined in .pyd files from an
>embedded Python interpreter.  The problem seems to be that two sets of
>variables are being used and no linking is happening when the DLL is
>loaded.  Perhaps you DLL gurus will spot the problem immediatly. 
>Details follow...

Thank you for posting such detailed research!

Extension modules are linked against an import lib for python15.dll. So 
they load python15.dll automatically, and use the symbols exported from the 
dll, not the ones statically linked into your embedded app.

While it is possible to export symbols from an .exe (in MSVC land, this 
produces an .exp file), I've never experimented with back-linking a dll to 
an exe.

Most people just use python15.dll from their embedding app so both get the 
same copy. Using Borland probably adds some warts to the process, since 
everybody has to end up using the same c runtime. Your best bet is to look 
for some posts by Gordon Williams, who has instructions on building python 
with Borland.

Good luck!

- Gordon



More information about the Python-list mailing list