Find all packages installed with easy_install/pip?

前端 未结 18 1251
醉话见心
醉话见心 2020-11-27 08:47

Is there a way to find all Python PyPI packages that were installed with easy_install or pip? I mean, excluding everything that was/is installed with the distributions tool

18条回答
  •  隐瞒了意图╮
    2020-11-27 09:40

    Here is the one-liner for fedora or other rpm distros (based on @barraponto tips):

    find /usr/lib/python2.7/site-packages -maxdepth 2 -name __init__.py | xargs rpm -qf | grep 'not owned by any package'
    

    Append this to the previous command to get cleaner output:

     | sed -r 's:.*/(\w+)/__.*:\1:'
    

提交回复
热议问题