On Apr 27, 2017, at 06:21 AM, Donald Stufft wrote:
For whatever it’s worth, at some point in time I plan on attempting
to
formalize the Debian solution (or something akin to it) within a PEP and try
to get baked in support for it in Python.
I also feel required to point out that ``sudo pip uninstall`` isn’t always
enough, because while the two systems install to different locations, pip
currently will uninstall the files in /usr when installing to
/usr/local. They’ve patched their copy of pip to refuse to uninstall files
from /usr, but upstream pip will still do it. Again, something I hope to get
sorted at some point (and of course, an upgrade totally restores the files in
/usr).
Also note that `pip install` defaults to --user in Debian, and that alleviates
a lot of the "well that didn't work, let me add sudo" urges. Upstream,
this
bug tracks that, although it's long standing without much recent progress:
https://github.com/pypa/pip/issues/1668
IMHO, that's the right direction to go, and I think Donald is philosophically
aligned (apologies if I'm misreading that, DS!). There are of course plenty
of knock-on issues to work out, which is probably why that issue is still
open.
Defaulting to --user won't solve all the problems but I think it's very much a
step in the right direction.
Even with this, over in Debuntu-land we sometimes still see bug reports from
people who were confused by importing an unexpected version of a package, and
not remembering (or knowing) that some third party version outside of the
archive had been installed, and /usr/local/lib does come before /usr/lib in
sys.path. This lead to
https://bugs.python.org/issue29546 which will be in
3.7 and should at least help in debugging such situations.
Cheers,
-Barry