我在系统中安装了一个使用distils的pycocotools版本。我想从一个不同的仓库中构建和安装,该仓库有较新的更改,并有一个问题得到修复。但是我得到了以下错误。你知道我该怎么解决这个问题吗?
(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.

发布于 2021-02-15 10:51:33
在这里我发布了最终的解决方案。
Step1:升级您的pip。
python -m pip install --upgrade pipStep2:找到安装的pycocotools的路径。一个简单的尝试是重新安装pycocotools,pip将为您提供路径
pip install pycocotools你会得到
Requirement already satisfied: pycocotools in /home/frank/.local/lib/python3.7/site-packages现在,我们知道pkg在/home/frank/.local/lib/python3.7/site-packages。
Step3:删除相关文件。
cd /home/frank/.local/lib/python3.7/site-packages
rm -rf pycocotools
rm -rf pycocotools-2.0-py3.7.egg-info 完毕。
然后你可以重新安装最新版本的pycocotools,或者永远不会被这个问题所困扰。
https://stackoverflow.com/questions/58297750
复制相似问题