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

M.-A. Lemburg mal at egenix.com
Wed Sep 3 13:25:47 CEST 2008

On 2008-09-03 04:12, Greg Ewing wrote:
> 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.

You have a point there :-)

> 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
> setting.

True, I have configured Windows to provide several
"Open with Python x.x" in order to have more flexibility.

However, always having the latest version on PATH is not
an option either, since e.g. I wouldn't want all .py scripts
to be run by Python 3.0 just because I installed it for
testing purposes.

>> 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
> on.

In my experience, Windows apps seem to be moving aways from
cluttering up PATH and include each and every single app
dir to it.

Instead, if they bother at all, they simply place a .bat or
small .exe into the Window system dir (which already is
on PATH).

Perhaps we could have an option to place a "python.bat"
into C:\Windows\ or C:\Windows\System\.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 03 2008)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-Dev mailing list