Python DLL in Windows Folder

Markus Gritsch m.gritsch at gmail.com
Sun Dec 23 13:27:41 EST 2007


On 23/12/2007, Christian Heimes <lists at cheimes.de> wrote:
> Markus Gritsch wrote:
> > why does the Python installer on Windows put the Python DLL into the
> > Windows system32 folder?  Wouldn't it be more clean to place it into
> > the Python installation folder beside the python.exe file?
>
> It's the easiest and best way to expose Python for 3rd party
> applications and COM. The DLL is removed by the Windows Installer when
> its usage counter drops to 0. There is no need to worry ;)

I am not worrying about an orphaned DLL.  The Problem is that this way
the Python DLL is being made available for 3rd party applications,
which possibly need a version of Python which is compiled using
another compiler.  We are embedding Python into our application which
gets compiled using MSVC 8.0.  We like to link dynamically, so the
Python interpreter is not statically linked into the program.  The
Python DLL from the Python installer in the Windows system32 folder is
compiled using MSVC 7.1.

Our current solution to the problem is modifying the Python build
process to produce our Python DLL with a filename containing also the
patchlevel of the version number i.e. python251.dll instead of
python25.dll.  This way we can be sure that *our* Python DLL gets
loaded.  This works fine.

I was just curious, if there is a special reason for placing the
Python DLL into the system32 folder.  So COM seems to be the answer.

Thank you,
Markus



More information about the Python-list mailing list