Statically linking standard Python modules into an application

Brian Forney bforney at cs.wisc.edu
Wed Mar 13 17:44:36 EST 2002


Hello,

I have embedded a Python interpreter into an application I wrote. The
application sometimes uses the standard Python modules, such as sys,
depending on the script it executes and loads them dynamically. This solution
works well most of the time.

It does not work well in distributed execution environment I often use. The
problem occurs when calling dlopen() to load Python modules. dlopen() and
other functions that use mmap() are unsupported, yet they sometimes work, in
this environment. I would like to remove calls to dlopen() by the Python
library. Is there a way to statically link in all of the standard modules
*and* the Python library *and* keep the Python library from calling
dlopen() for standard modules?

Brian Forney





More information about the Python-list mailing list