[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 21:36:22 CEST 2015


On 16 May 2015 at 20:04, Chris Barker <chris.barker at noaa.gov> wrote:
> I was referring to the SetDllDirectory API. I don't think that gets picked
> up by other processes.
>
> from:
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms686203%28v=vs.85%29.aspx
>
> It looks like you can add a path, at run time, that gets searched for dlls
> before the rest of the system locations. And this does to effect any other
> applications. But you'd need to make sure this got run before any of the
> effected packages where loaded -- which is proabbly what David meant by
> needing to "control the python binary".

Ah, sorry - I misunderstood you. This might work, but as you say, the
DLL Path change would need to run before any imports needed it. Which
basically means it needs to be part of the Python interpreter startup.
It *could* be run as normal user code - you just have to ensure you
run it before any imports that need shared libraries. But that seems
very fragile to me. I'm not sure it's viable as a generic solution.

Paul


More information about the Distutils-SIG mailing list