[Python-Dev] Add python.exe to PATH environment variable

"Martin v. Löwis" martin at v.loewis.de
Mon Sep 8 07:53:40 CEST 2008


>> I mean that many Windows use the PATH, and as such, may fail if a new
>> directory is added to the PATH that contains a DLL they indirectly use.
> 
> Then it's just a matter of not putting any DLLs in those directories, isn't it?

A. It's not just DLLs. Any program invoking CreateProcess might pick up
   the Python executable. This might be confusing if the program would
   previously pick up a different Python installation.
B. I don't think this can work: we *must* install DLLs into the Python
   directory - at least pythonxy.dll (at least the way Python is
   currently build - maybe SxS would allow to place it elsewhere).
   I *think* we also need to place the CRT manifest in the directory;
   not sure what consequences this has.

> Most Linux distributions solve that by installing binaries named
> /usr/bin/python2.4, /usr/bin/python2.5, etc., and making /usr/bin/python a
> symlink to one of those. Thus if a program relies on particular Python version,
> it can just use a specific executable rather than a generic one.

Unfortunately, symlinks are not available on Windows.

OTOH, other things *are* available, such as registered extensions.
For example, you don't need python on PATH to start a Python script;
just invoking the .py file will find the Python interpreter from the
registry.

I don't think it is wise to apply Unix solutions to Windows problems.

Regards,
Martin



More information about the Python-Dev mailing list