[issue27924] ensurepip raises TypeError after pip uninstall

Nick Coghlan report at bugs.python.org
Thu Sep 1 01:44:52 EDT 2016


Nick Coghlan added the comment:

Yeah, this is a known problem with pip where if you run it with sudo, it will happily uninstall system managed files from the system Python.

To fix your system (if you haven't already):

    $ sudo dnf reinstall python2-pip

(Anyone that accidentally uninstalls one of DNF's dependencies is in for a world of pain, but fortunately for this case pip doesn't fall into that category)

For the actual "pip currently happily uninstalls distro packages when run with sudo" problem, https://mail.python.org/pipermail/distutils-sig/2016-January/028080.html is the most recent discussion of that situation.

So we have a basic concept in place for how to make "sudo pip uninstall" less dangerous, it just requires coordination between PyPA updates to pip and downstream distro packaging policies to get us there.

----------
nosy: +encukou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27924>
_______________________________________


More information about the Python-bugs-list mailing list