首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何卸载通过distils安装的pycocotools

如何卸载通过distils安装的pycocotools
EN

Stack Overflow用户
提问于 2019-10-09 13:47:41
回答 1查看 621关注 0票数 3

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

代码语言:javascript
运行
复制
(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.

EN

回答 1

Stack Overflow用户

发布于 2021-02-15 10:51:33

在这里我发布了最终的解决方案。

Step1:升级您的pip。

代码语言:javascript
运行
复制
python -m pip install --upgrade pip

Step2:找到安装的pycocotools的路径。一个简单的尝试是重新安装pycocotools,pip将为您提供路径

代码语言:javascript
运行
复制
 pip install pycocotools

你会得到

代码语言:javascript
运行
复制
Requirement already satisfied: pycocotools in /home/frank/.local/lib/python3.7/site-packages

现在,我们知道pkg在/home/frank/.local/lib/python3.7/site-packages

Step3:删除相关文件。

代码语言:javascript
运行
复制
cd /home/frank/.local/lib/python3.7/site-packages
rm -rf pycocotools
rm -rf pycocotools-2.0-py3.7.egg-info 

完毕。

然后你可以重新安装最新版本的pycocotools,或者永远不会被这个问题所困扰。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58297750

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档