Reputation: 18114
How can one have programs use a Python not listed in the Windows registry, NOT search the Windows System path for the PythonXX.dll?
Given this layout:
C:\dev\bin\python.exe
C:\dev\bin\python27.dll <-- our version
PYTHONHOME=C:\dev\apps\Python27 <-- DLLs, Lib, site-packages, etc.
C:\Windows\System32\Python27.dll <-- incompatible version!
We need other programs to use our .dll, but they find the incompatible system one first and fail:
SET PATH=C:\dev\bin
C:\dev\apps\3rdparty\foo.exe
<<fails to start>>
rename C:\Windows\System32\python27.dll C:\Windows\System32\python27.dll.orig
C:\dev\apps\3rdparty\foo.exe
<<runs just fine>>
Deleting or removing the system .dll is not an option, the above is just for illustration. We could kludge it to work moving to foo.exe to dev\bin\
and thus be along side python27.dll, but that introduces a package maintenance overhead and a host of other integration issues we'd really rather not have to deal with.
Upvotes: 3
Views: 1124
Reputation: 281875
You need to put a copy of your python27.dll
in C:\dev\apps\3rdparty
.
The System directory is always searched before the PATH, but the executable directory comes before either of them - see Dynamic-Link Library Search Order in MSDN.
Upvotes: 4