[Distutils] Make ez_setup.py/easy_install $PATH aware

John J Lee jjl at pobox.com
Sun Sep 17 14:45:02 CEST 2006


On Sat, 16 Sep 2006, Phillip J. Eby wrote:
[...]
> By the way, it's easy_install that we actually need to worry about, not
> ez_setup.  ez_setup's only job is to download and run easy_install, which
> then handles everything from there.  So both issues can be handled that way.
>
> Windows is probably the main offender, here, however, and I'm not sure
> there's really a good solution there.  I don't think there's a standard
> $PATH directory that really makes sense for all circumstances, to name just
> one issue.  So, suggestions on what should happen there would be helpful.

Perhaps easy_install on Windows should:

(I guess step 2. is best done by creating a Windows installer with one of 
the standard tools (e.g. MSI / msilib)?)

0. Whenever a check is required that executable files are "on the path",
    call SearchPath():

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/searchpath.asp

1. Having created a directory for installed Python scripts and set the
    appropriate registry key at easy_install install time (see step 2),
    always install Python scripts in that directory.

2. So that easy_install itself can be run without too much user effort,
    either:

   a. Always install easy_install.exe to C:\Python2?\Scripts, but warn if
      it's not on the path.  -1 from me, it doesn't seem the "Windows way"
      to have to have PATH set correctly in order for things to work.

   b. Create C:\Program Files\PJE\EasyInstall and
      C:\Program Files\PJE\EasyInstall\Scripts and install easy_install.exe
      in the latter.  Add the appropriate registry key to put the latter
      "on the path":

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemain4/html/_wcepb_Search_Path_Registry_Settings.asp

(where of course C:\Python2? and C:\Program Files would have to be looked 
up using the appropriate system call / registry key)

Of course, it would be even more Windowsy if somebody then wrote a little 
GUI that allowed you to search PyPI, select projects and click a button to 
install them. :-)  But the other stuff seems much more useful than point & 
click stuff: it would "just work" for the Windows easy_install target 
audience -- who surely know how to use the DOS command line, but who like 
most of us, are easily put off by complicated installation dances 
involving setting PATH etc.  Windows just doesn't really like PATH -- 
there's even a fairly short fixed limit on the length of PATH &c. you can 
type into the dialog box when you're setting up the properties of a 
shortcut (?) to cmd.exe, so if you want to maintain a couple of different 
"shell" environments that way and you install too many programs, you're 
out of luck!


John



More information about the Distutils-SIG mailing list