Where is wxPython?

Paul Moore paul.moore at uk.origin-it.com
Wed Oct 25 06:00:16 EDT 2000


On Wed, 25 Oct 2000 01:04:34 +0200, Robin Dunn <robin at alldunn.com>
wrote:

>In article <W1D1OXXKKVYwhIFEhiAVX9tf3dlq at 4ax.com>,
>  Paul Moore <paul.moore at uk.origin-it.com> wrote:
>>
>> PS The 2.0b1 version installed some DLLs in my WINNT\SYSTEM32
>> directory. The uninstall removed them OK, but on general principle, I
>> prefer applications which don't do this. Is there no way these DLLs
>> can be installed with the wxPython module?
>>
>
>Because of the brain-dead way that MSW searches for dll's and since it's
>python.exe or pythonw.exe that is actually loading the dll, the only
>options are to put the dll in the SYSTEM directory, in the same
>directory as python.exe or in a directory on the PATH.  If I put the dll
>in the wxPython package directory it won't be found at runtime unless
>that directory is added to the PATH, which make no sense otherwise.
>Putting it in the SYSTEM directory seemed to be the lesser of available
>evils.
>
>Now that I think about it though, there may be a way to do it but it
>would mean more mucking around in the registry...  I'll have to try and
>figure it out one of these days.

Fiddling in the registry is even worse...

Actually, I believe that you should be able to put the DLL in the same
directory as the DLL which uses it (ie, the wxPython PYD file). I've
done this with other modules and it seems to work.

Basically, Python itself loads DLLs (PYDs) from explicit directories
in sys.path. If these DLLs load other DLLs, I believe that the search
path includes the directory in which the loading DLL is located,
rather than the directory in which the original EXE is located. The
Windows documentation seems to imply otherwise - all I can say is that
it seems to work.

[Looking a bit further] There is LoadLibraryEx(..., ...,
LOAD_WITH_ALTERED_SEARCH_PATH) which behaves as I described. Looks
like that is what Python is using.

Just checked the source - yes, that's what it is doing. SO this should
work - at least on Python 2.0, I don't have older sources to check.

Hope this helps,
Paul.




More information about the Python-list mailing list