How to find which pip package owns a file?

前端 未结 3 683
梦毁少年i
梦毁少年i 2021-01-03 23:47

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

In other words, I\'m looking for a command similar

3条回答
  •  情书的邮戳
    2021-01-04 00:30

    You could try with

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

    Then search through the results looking for that file.

提交回复
热议问题