Unable to uninstall a python package using pip if it was installed using -t option

Viewed 531

I have installed docker-compose using:

sudo pip install docker-compose -t /usr/bin

but now when I try to uninstall it I got the following error:

sudo pip uninstall docker-compose
Found existing installation: docker-compose 1.29.2
Not uninstalling docker-compose at /usr/bin, outside environment /usr
Can't uninstall 'docker-compose'. No files were found to uninstall.

I have tryed some work arounds such as:

sudo pip install --force-reinstall docker-compose --no-cache-dir

sudo pip install --ignore-installed docker-compose --no-cache-dir

but they didn work.

1 Answers

It looks like some old installation of docker-compose using apt-get was interfering with pip package database, causing the problem.

I run:

sudo apt-get --purge autoremove docker-compose

and then I was able to uninstall the package using:

sudo pip uninstall docker-compose

Related