[Distutils] Dynamic linking between Python modules (was: Beyond wheels 1.0: helping downstream, FHS and more)

Paul Moore p.f.moore at gmail.com
Sat May 16 20:54:52 CEST 2015


On 16 May 2015 at 19:40, Chris Barker <chris.barker at noaa.gov> wrote:
>> With 2., you still have the issue of DLL hell,
>
> could you clarify a bit -- I thought that this could, at least, put a dir on
> the search path that was specific to that python context. So it would
> require cooperation among all the packages being used at once, but not get
> tangled up with the rest of the system. but maybe I'm wrong here -- I have
> no idea what the heck I'm doing with this!

Suppose Python adds C:\PythonXY\SharedDLLs to %PATH%. Suppose there's
a libpng.dll in there, for matplotlib. Everything works fine.

Then I install another non-Python application that uses libpng.dll,
and does so by putting libpng.dll alongside the executable (a common
way of making DLLs available with Windows applications). Also assume
that the application installer adds the application directory to the
*start* of PATH.

Now, Python extensions will use this 3rd party application's DLL
rather than the correct one. If it's ABI-incompatible, the Python
extension will crash. If it's ABI compatible, but behaves differently
(it could be a different version) there could be inconsistencies or
failures.

The problem is that while Python can add a DLL directory to PATH, it
cannot control what *else* is on PATH, or what has priority.

Paul


More information about the Distutils-SIG mailing list