[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Removing old python packages installed with pip



On Fri 01 Dec 2017 at 12:42:35 (-0300), Eike Lantzsch wrote:
> On Friday, December 1, 2017 3:24:47 PM -03 Urs Thuermann wrote:
> > On a machine running Debian stretch I have installed python3, which is
> > currently python3.5.  Nothing of python3.4 is present.
> > 
> > But in /usr/local/lib/python3.4/dist-packages/ a number of packages is
> > still installed.  Probably, these have been installed using pip3 when
> > python3.4 was current.
> > 
> > Now, it seems pip3 isn't able to remove packages from that old
> > directory.  Is it safe to just rm -r /usr/local/lib/python3.4?

You should preserve /usr/local/lib/python3.4/dist-packages/,
so removing just the files, and not *all* the directories, is safer.

> If those packages were installed together with the Debian system then 
> deinstall with aptitude or apt remove.

If Debian installs files (other than empty directories) under
/usr/local/, I would file a bug. That tree is for you, not Debian.

> If you mix two different package installers the consequence is that one does 
> not know about the other and they can interfere with each other.
> On Debian always install packages the "Debian way".
> Don't make a Frankendebian:
> https://wiki.debian.org/DontBreakDebian

My understanding of "Frankendebian" is a system that mixes *Debian*
versions. There have to be ways of adding other suites of software
to a Debian system and, if they're for general rather than personal
use, the /usr/local/ tree is a good way to go. Why else bother to
have /usr/local/bin in the default $PATH?

>From the reference above: "Installing software to the /usr/local will
make it available to all users, and will not interfere with the
package manager. The stow package can be useful for managing software
installed to /usr/local."

Cheers,
David.


Reply to: