3

I have a pycocotools version installed using distils in my system. I want to build and install from a different repo that has more recent changes and which has a issue fixed. But I get the following error. Any idea how I can resolve this issue?

(base) root@tf-notebook-nirandi-855bcb7b58-wxsc9:/notebooks/shared-datasets/shared-datasets/demos/mask-r-cnn# pip install -e git+https://github.com/waleedka/coco.git#egg=coco\&subdirectory=PythonAPI
Obtaining coco from git+https://github.com/waleedka/coco.git#egg=coco&subdirectory=PythonAPI
  Cloning https://github.com/waleedka/coco.git to ./src/coco
  Running command git clone -q https://github.com/waleedka/coco.git /notebooks/shared-datasets/shared-datasets/demos/mask-r-cnn/src/coco
  WARNING: Generating metadata for package coco produced metadata for project name pycocotools. Fix your #egg=coco fragments.
Installing collected packages: pycocotools
  Found existing installation: pycocotools 2.0
ERROR: Cannot uninstall 'pycocotools'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

enter image description here

user77005
  • 1,769
  • 4
  • 18
  • 26

1 Answers1

0

Here I post the final solution.

Step1: Upgrade your pip.

python -m pip install --upgrade pip

Step2: Locate the path of the installed pycocotools. One simple try is to reinstall pycocotools, and pip will give you the path

 pip install pycocotools

You will get

Requirement already satisfied: pycocotools in /home/frank/.local/lib/python3.7/site-packages

Now, we know the pkg is at /home/frank/.local/lib/python3.7/site-packages.

Step3: Delete related files.

cd /home/frank/.local/lib/python3.7/site-packages
rm -rf pycocotools
rm -rf pycocotools-2.0-py3.7.egg-info 

Over.

Then you can reinstall the lastest version of pycocotools or just never be bothered by this.

Frank
  • 1,151
  • 10
  • 22