txicos
txicos

Reputation: 289

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

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.

Upvotes: 2

Views: 2595

Answers (1)

txicos
txicos

Reputation: 289

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

Upvotes: 1

Related Questions