Static python compile on windows.

Thomas Heller theller at
Wed Jul 28 12:28:43 CEST 2004

"Martin v. Löwis" <martin at> writes:

> You should build as many static libraries as you need, e.g.
> python23s.lib, qtXYs.lib, and so on. Static libraries don't depend
> on each other, so you can build them independent from one another.
> You should then link them all together, either linking them into
> python.exe or pythonw.exe.

Please let me join this thread with a related question.
I've added a project to the MSVC6 workspace for Python 2.3, which
basically does this.  It seems required to define the
Py_NO_ENABLE_SHARED preprocessor flag when compiling this.

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)?


More information about the Python-list mailing list