Static python compile on windows

Wiktor Sadowski art at wiktorsadowski.com
Wed Jul 28 18:19:23 EDT 2004


Thomas Heller writes:
>Now I have a ~900 kB static python.exe. How can I prevent that this exe
>tries to import extension modules from the file system - it always
>crashes with a Fatal Python error: Interpreter not initialized (because
>it tries to load the normal python23.dll which I have also installed)?


Hi Thomas,

Static Python.exe.(2.3.4) works for me.
However  we don't use zipimport module ( we have our own import engine)
As far as I remember zipimport imports zlib.dll/pyd , but you can't import
dll modules from static
python.exe (well. it would be possible by passing python api to an extension
, kind of Netscape/Mozilla plugin approach).
But you could add zlib module to your static Python23.lib and initzlib to
PyImport_Inittab (config.c).
It should solve the zipimport problem.
As for disabling dll imports:
IMO the simplest  way is to modify import.c find_module - remove/disable
C_EXTENSION support if Py_NO_ENABLE_SHARED is defined.

hope this helps,
Wiktor Sadowski

BTW :Thanks for excellent ctypes!








More information about the Python-list mailing list