Re: Why does Python never add itself to the Windows path?



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

.



Relevant Pages

  • cx_Freeze 4.1
    ... cx_Freeze is a set of scripts and modules for freezing Python scripts ... into executables in much the same way that py2exe and py2app do. ... Enabled support for compiling on 64-bit Windows. ...
    (comp.lang.python.announce)
  • cx_Freeze 4.0b1
    ... cx_Freeze is a set of scripts and modules for freezing Python scripts ... into executables in much the same way that py2exe and py2app do. ... Added support for copying binary dependent files ...
    (comp.lang.python.announce)
  • Re: Why does Python never add itself to the Windows path?
    ... The python part of the 'python setup.py install' idiom needs to be omitted on ... that solution only works for actual Python scripts; ... Unix identifies executables. ...
    (comp.lang.python)
  • Re: Graphics routines (GDCHART, etc.) with OpenVMS PERL, CSWS mod_perl
    ... > graphs for Apache (CSWS) pages and was pointed to Python for VMS. ... the installs went smoothly and I am able to ... > The documentation mentioned PNG and ZLIB as prerequisites. ...
    (comp.os.vms)
  • [ANN] BPT (Boxed Package Tool) 0.4a -- now with PIP support
    ... This release is particularly interesting for python users, since it includes a modified version of PIP that installs the packages inside the box. ... What is BPT ...
    (comp.lang.python)