Why does Python never add itself to the Windows path?

Ben Sizer kylotan at gmail.com
Wed Jan 3 18:13:30 CET 2007

Chris Lambacher wrote:
> On Tue, Jan 02, 2007 at 09:08:41AM -0800, Ben Sizer wrote:
> > Chris Lambacher wrote:
> > > The python part of the 'python setup.py install' idiom needs to be omitted on
> > > Windows, but that does not mean that the solution is to automatically add it
> > > to PATH.
> >
> > Firstly, that solution only works for actual Python scripts; it doesn't
> > solve the utility scripts that are often installed to the /scripts
> > directory. It's a shame that many responses on this thread don't
> > address that half of the issue. Am I the only person who installs
> > packages that add scripts (not all of which are Python ones)?
> Nope, but just adding the scripts directory to the PATH does not solve the
> problem.  You also need to either create an executable launcher (.bat  or
> .exe) for the script or mess with environment variables to tell Windows to
> treat .py files a executable.  This issue is solved in Unix by toggling the
> executable bit on the file in the file system.

Many of the scripts that are installed come as batch files or other
executables. They just assume the directory is in your PATH already,
which they aren't, until you set it that way.

> > Secondly, it's still a significant difference from the Unix-based
> > installs.
> Its not really.  Unix installs default to being installed to the prefix /usr,
> which just happens to put the executable in your path.  It does not modify the
> user's path in any way.

I was talking more in terms of the end-user experience. I don't know of
any binary package on the distros I've used (Mandriva/Mandrake, Fedora
Core, and Kubuntu) that install Python without it going into your path,
nor of any that allow you to avoid that while using their standard
package managers. It may be incidental in some meaning of the term, but
it's expected and apparently intended.

Ben Sizer

More information about the Python-list mailing list