如何找到哪个pip包拥有一个文件? [英] How to find which pip package owns a file?

查看:104
本文介绍了如何找到哪个pip包拥有一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我怀疑是pip安装的文件. 如何找到哪个软件包安装了该文件?

I have a file that I suspect was installed by pip. How can I find which package installed that file?

换句话说,我正在寻找与pacman -Qo filenamedpkg -S filename类似的命令,但对于pip.是否存在?还是应该使用pipgrep的某种组合? 在这种情况下,我不知道如何列出所有已安装的文件.

In other words, I'm looking for a command similar to pacman -Qo filename or dpkg -S filename, but for pip. Does it exist? Or should I use some combination of pip and grep? In that case, I don't know how to list all the file installed.

推荐答案

您可以尝试

pip list | tail -n +3 | cut -d" " -f1 | xargs pip show -f | grep "filename"

然后搜索结果以查找该文件.

Then search through the results looking for that file.

这篇关于如何找到哪个pip包拥有一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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