Controlling load location of python22.dll when using Py_Initialize()

quadric at quadric at
Wed Feb 19 06:03:45 CET 2003

Hi again,

Further to my question below, it seems my thinking is a bit screwed up here 

I am statically linking with python22.lib which is an import/export library 
python22.dll.  I am not using LoadLibrary() and therefore am relinquishing 
control of the
DLL search mechanism to Windows OS.  Is this correct?  Py_Initialize() is 
simply a call
to a function that exists in a DLL that the OS should have already 
loaded.  Correct?

If so, and as I understand it, the Windows OS will always first search the 
calling applications
directory and then search along the PATH.  Is this correct?

If so, then I must locate python22.dll in applications directory.

Is this correct?

Thanks again for the help.

At 09:39 PM 2/18/2003 -0700, you wrote:
>I have embedded Python in an application and would like to control the 
>location from
>whence the application loads python22.dll  upon calling 
>Py_Initialize().  I don't want to
>rely on the PATH variable as Python is already installed on this machine 
>and I want the
>application to load the application specific version of python22.dll.   I 
>have tried using
>PYTHONPATH and PYTHONHOME but to no avail.  It seems that the applications 
>and directories along the PATH are the only ones searched.
>I have traced through the source for Py_Initialize() and it seems that the 
>Windows Registry
>is searched for certain keys and the directories along the PATH.  I am not 
>opposed to using
>the applications directory but would prefer to control the load location 
>Can someone tell me how to tell Py_Initialize() where to look for 
>Thanks for your help.

More information about the Python-list mailing list