[Python-Dev] Remove site-packages?!? [was: [Distutils] PEP 376 - from pythonpkgmgr's point of view]

David Lyon david.lyon at preisshare.net
Wed Jul 22 01:38:20 CEST 2009


On Tue, 21 Jul 2009 13:41:41 -0400, Tres Seaver <tseaver at palladion.com>
wrote:
>>> The main problem imho has been that easy_install by default
>>> has installed to /usr/lib/pythonX.X/site-packages when in
>>> fact that really is an operating system controlled directory.
>>>
>>> So naughty naughty to setuptools....
..
> That behvior isn't setuptools' fault:  it is the behavior of *any*
> distutils-derived app.  "OS controlled directory" is not a concept which
> the distutils honors at all:  $prefix/lib/pytoonX.Y/site-packages is the
> *intended* installation location for any modules not shipped with Python.

Ok - so naughty distutils...

> Consider the case where the user has built a separate python (e.g., to
> avoid conflicting with the OS version) in /opt/PythonX.y:  are you
> actually saying that distutils / setuptools should somehow know the
> difference betweeen /usr/lib/pythonX.y/site-packages and
> /opt/PythonX.Y/lib/pythonX.Y/site-packages?  

It already does.

If you run the python in /opt/pythonX.X you'll get a different value
for sys.path than when you run the other python from /usr/lib/pythonX.X.

Try it and see for yourself..

That's because sys.path is calculated relatively within site.py
depending on where the interpretor is run from.

> Or are you asserting that
> it is somehow invalid for distutils / setuptools to install things into
> /opt/PythonX.Y/lib/pythonX.y/site-packages, which is certainly not an
> "OS controlled directory."

Not at all.

All I'm saying is that after so many years of python under linux and
operating system we should have observed the common use cases and
learned a thing or two.

If you hadn't noticed, there is mayhem in package installation because
the operating system tries to install its packages in the same place
as setuptools does in development mode.

That has got to be asking for trouble..

When I go into python on ubuntu I see there is /usr/local/pythonX.X/lib/
site-packages and I'm wondering why the hubba setuptools/distutils
doesn't put packages there by default. That would solve a lot of
problems.

Just leave /usr/lib/pythonX.X//lib/site-packages to the O/S.

Wrapping up.. most of the functionality that I'm asking for is
already there. So I don't require anything extra. I don't want
things taken out.

All I'm suggesting is that we use what we already have a bit smarter.

David




More information about the Python-Dev mailing list