[Distutils] shebang line modified by setuptools

Floris Bruynooghe floris.bruynooghe at gmail.com
Fri Apr 18 10:05:32 CEST 2008


On Sun, Apr 13, 2008 at 07:59:21AM -0400, Barry Warsaw wrote:
> On Apr 12, 2008, at 9:41 PM, Stephen Waterbury wrote:
> >
> > I used to always set up my own Python[s] in /usr/local
> > and put that first in my PATH, but I have gotten lazy lately, and
> > sometimes it will bite me. ;)
> 
> On Debian and derivatives (e.g. Ubuntu) you might have even more fun.   
> They put /usr/local/lib/pythonX.Y/site-packages on the sys.path *of  
> the system python*!  This means that you can break your system Python  
> by installing a version of Python from source and then distutil'ing  
> things into there.  Astoundingly, this is promoted as a feature.
> 
> I've reported bugs on this and had discussions with some of the Debian  
> Python packaging folks.  I'm hoping that we'll find a solution that  
> doesn't collide with a from-source default Python build.

I think it would be really good if we could agree on a simple solution
for this problem.  However I haven't really seen an agreement come out
of this thread.  So far what (I think) some proposed solutions are:

1 Have a different path in /usr/local (not
  /usr/local/lib/pythonX.Y/site-packages) to augment the system
  sys.path with.

2 Make sure /usr/local is near the end of the sys.path so system apps
  won't break due to it (currently
  /usr/local/lib/pythonX.Y/site-packages appears before
  /usr/lib/pythonX.Y/site-packages on my system, not sure if this is
  normal and if not who's fault that is).

3 Don't support compiling your own python in /usr/local, do that in
  /opt.

4 Introduce a hidden python on the system which the system uses to run
  system applications that use python.  The user would be unable to
  change that environment unless they really tried.  (But surely then
  there are still discussions about which paths end up on sys.path for
  the user python and which paths are for locally compiled pythons, I
  might have missed something in this discussion).


Personally I think the solution should be as simple as possible so I'd
go for 1, 2 or 3.  3 will be difficult to teach people (definitely if
they disagree) so that won't work, which leaves 1 and 2.


Opinions?

Regards
Floris

-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org


More information about the Distutils-SIG mailing list