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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Sep 3 04:12:57 CEST 2008

M.-A. Lemburg wrote:

> The problem is: how to undo those changes without accidentally
> undoing an explicit change made by the user ?

Is that really much of an issue? If the PATH contains an
entry corresponding to the Python installation that's
being uninstalled, then it's not going to work once the
installation is gone, so removing it isn't going to do
much harm.

In any case, the danger could be reduced by picking
some distinctive name for a new environment variable that
a user isn't likely to come up with on their own, such
as __AUTOPYEXECDIR__, setting that to the Python directory,
and adding it to PATH. The uninstaller can then be fairly
selective about what it removes.

> BTW: Adding the Python dir to the PATH per default would cause
> problems for users who regularly have multiple different
> Python installations on a machine.

No more problem than having it set the file associations,
as far as I can see. If you have multiple Pythons, you're
going to have to be explicit about which one you want
from the command shell anyway, and not rely on a PATH

> If this is done, it should be an install option and not forced.

Certainly it should be an option. I'm not sure about
having it disabled by default, though, since naive users
are the ones that stand to benefit most from it, yet
they're least likely to know that they need to turn it


More information about the Python-Dev mailing list