pip冻结列表已卸载的软件包 [英] pip freeze lists uninstalled packages

查看:106
本文介绍了pip冻结列表已卸载的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OS X 10.6.8上,我使用(至少是pip告诉我)卸载了软件包

On OS X 10.6.8, I uninstalled a package using (at least pip tells me so)

sudo pip uninstall pkg_name

但是当我这样做时,包裹仍然显示

but the package still shows up when I do

pip freeze

我尝试再次执行上述卸载命令,并且pip告诉我该软件包未安装.

I try to do the uninstall command above again, and pip tells me the package is not installed.

这是什么问题?如何验证软件包是否已卸载?如果是这样,我可以刷新某种点子的索引来进行更正吗?

What is the problem here? How do I verify whether the package is uninstalled or not? If so, can I refresh some sort of index of pip to get it corrected?

推荐答案

我认为您可能有两个pip二进制文件,并且当您以sudo身份运行时,您的shell首先会选择错误的二进制文件.但是,如果在sudopip删除软件包的情况下再次运行它,则没有任何意义.你确实做到了吗?

I thought you may have two pip binaries, and when you run as sudo, your shell chooses the wrong one, at first. But it does not make any sense if you run it again as sudo and pip removed the package. Did you do exactly this?

如果没有两次运行 same 命令,则可能有不同的pip二进制文件正在运行卸载和冻结.检查以下两个命令是否产生相同的输出:

If you did not run the same commands twice, you may have different pip binaries running the uninstall and freeze. Check if the following two commands result in the same output:

$ sudo pip freeze
# ... sudo output
$ pip freeze
# ... normal output

无论如何,您可以使用以下方法检查软件包是否已安装:

Anyway, you can check if the package is installed using:

$ python -c 'import pkg_name' &> /dev/null && echo installed || echo not installed

pip中没有任何刷新功能.

There is no sort of refresh feature in pip.

这篇关于pip冻结列表已卸载的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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