[Distutils] distil 0.1.1 released

Carl Meyer carl at oddbird.net
Sat May 4 00:37:52 CEST 2013


Hi Nick

On 05/03/2013 12:14 PM, Nick Coghlan wrote:
> I would also be relatively happy for pip to refuse the temptation to
> guess if run globally and require an explicit --user or --system
> whenever it is run outside a virtual environment. However, I think it's
> better to make the typical "pip install whatever" work for most
> unprivileged users without requiring elevated privileges.
> 
> I agree the proposed exception for root doesn't make sense so I withdraw
> that idea, even though installing things into root's home directory is a
> little strange.
> 
> As far as Debian's dist-packages setup goes, that's their workaround for
> this misfeature of the current Python packaging ecosystem.

IMO requiring either --user or --system is bad UI (we should have a sane
default). Defaulting to --user is tempting, but also a bad idea, both
because of the massive adjustment that it would require from existing
users, and because it does the wrong thing in many cases where there are
multiple Pythons compiled on the system.

I think the best solution to this problem is quite easily implemented
and non-intrusive: an improved error message when pip finds that it
lacks permission to install to site-packages. This error message could
recommend --user and/or virtualenv, could warn quite strongly against
installing to this location unless you really know what you are doing, etc.

Also, I think that for the specific situation of a Linux distribution's
"system Python" (which, as Donald has pointed out, is only one mode of
Python installation out of many), Debian's solution is better than just
a workaround, it is conceptually more or less the Right Thing: separate
distro-managed Python code from user-managed Python code, without
preventing independent installation of Python-installation-wide code by
the user.

(Though some aspects of the implementation of Debian's solution are
sub-optimal and have required ugly workarounds in pip. It would be
better if multiple site-packages were a first-class concept in Python's
own site.py so Debian's solution could be implemented via configuration
rather than patches.)

Carl


More information about the Distutils-SIG mailing list