为什么Pip无法卸载pysqlite? [英] Why can't pip uninstall pysqlite?

查看:139
本文介绍了为什么Pip无法卸载pysqlite?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用pip从系统中删除pysqlite.

I'm trying to remove pysqlite from my system using pip.

我这样做是没有道理的:

What I get doing so makes no sense:

$ pip uninstall pysqlite

该命令有效,但是请注意:

The command worked, but watch this:

$ pip freeze
[...]
pysqlite==1.0.1

让我们再试一次

$ pip uninstall pysqlite
Can't uninstall 'pysqlite'. No files were found to uninstall.

Nop,似乎已删除,但仍显示在pip freeze

Nop, seems removed but still show up in pip freeze

现在变得很有趣

$ pip install pysqlite
Requirement already satisfied (use --upgrade to upgrade): pysqlite in /usr/lib/python2.6/dist-packages
Cleaning up...

足够公平:

$ pip install -U pysqlite
[...]
error: command 'gcc' failed with exit status 1
[...]
Can't roll back pysqlite; was not uninstalled
[...]

我就是不明白.为什么Pip无法卸载pysqlite?

I just don't get it. Why can't pip uninstall pysqlite?

推荐答案

转到您的/usr/lib/python2.6/site-packages/pysqlite*.egg/(或在python路径中存储鸡蛋的其他任何地方)并查找installed-files.txt文件.

Go to your /usr/lib/python2.6/site-packages/pysqlite*.egg/ (or anywhere else you store your eggs in your python path) and look for the installed-files.txt file.

如果它不存在,则pip将无法将其卸载,如果存在,则将其中的所有文件删除,并摆脱pysqlite.而且正如Martijn所建议的那样,您还应该检查是否没有使用其他软件包管理器来安装软件包.

If it does not exists, pip will not be able to uninstall it, if it does, you remove all the files within and you're rid of pysqlite. And as Martijn suggests, you should also check if you did not install your package with another package manager.

如果没有installed-files.txt,并且尚未通过第三方软件包管理器安装软件包,则应查找鸡蛋所在的位置,并将其从python路径中删除.通常,鸡蛋还会在放置它们的目录中写入文件,因此您应该在放置pysqlite.egg的目录中寻找一个pysqlite/目录.

If you don't have the installed-files.txt, and your package has not been installed through a third-part package manager, you shall look up where your egg is, and remove it from the python path. Usually, eggs also write files in the directory where they lay, so you should look for a pysqlite/ directory in the directory where lays pysqlite.egg.

这篇关于为什么Pip无法卸载pysqlite?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆