手动删除pip包后如何删除 [英] How to remove pip package after deleting it manually

查看:322
本文介绍了手动删除pip包后如何删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以rm -rf命令删除了一个点子软件包,认为该软件包将被删除.现在,该软件包已被删除,但仍显示在pip list中,并且无法使用pip uninstall删除它,也无法使用pip install --upgrade更新.

我想将其完全删除.谁能告诉我如何?

编辑

程序包是psycopg2.

如果我尝试卸载:

hammad@hammad-P5QL-E:~$ pip uninstall psycopg2
Can't uninstall 'psycopg2'. No files were found to uninstall.

这是psycopg2所在的目录/usr/lib/python2.7/dist-packages,我rm -rf从同一目录中找到它.

TIA

解决方案

使用pip安装的软件包可以使用

完全卸载

pip uninstall <package>

参考链接

如果使用python setup.py install安装软件包,则

pip uninstall可能会失败,因为它们不会留下元数据来确定安装了哪些文件.

如果

pip uninstall <package>

软件包的路径(.pth文件)仍然存在于您的site-packages或dist-packages文件夹中,则它们仍会显示在pip list中.如果要使用rm -rf

进行删除,则也需要将其删除.

I deleted a pip package with rm -rf command thinking that the package will be removed. Now the package has been deleted but it still shows up in pip list and I'm unable to remove it with pip uninstall nor can I update with pip install --upgrade.

I'd like to remove it completely. Can anyone please tell me how?

EDIT

The package is psycopg2.

If I try to uninstall :

hammad@hammad-P5QL-E:~$ pip uninstall psycopg2
Can't uninstall 'psycopg2'. No files were found to uninstall.

This is the directory in which psycopg2 was located /usr/lib/python2.7/dist-packagesand I rm -rf 'd it from the same directory.

TIA

解决方案

packages installed using pip can be uninstalled completely using

pip uninstall <package>

refrence link

pip uninstall is likely to fail if the package is installed using python setup.py install as they do not leave behind metadata to determine what files were installed.

packages still show up in pip list if their paths(.pth file) still exist in your site-packages or dist-packages folder. You'll need to remove them as well in case you're removing using rm -rf

这篇关于手动删除pip包后如何删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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