How can I get a list of locally installed Python modules?

前端 未结 30 2584
庸人自扰
庸人自扰 2020-11-22 04:32

I would like to get a list of Python modules, which are in my Python installation (UNIX server).

How can you get a list of Python modules installed in your computer?

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 05:08

    Now, these methods I tried myself, and I got exactly what was advertised: All the modules.

    Alas, really you don't care much about the stdlib, you know what you get with a python install.

    Really, I want the stuff that I installed.

    What actually, surprisingly, worked just fine was:

    pip freeze
    

    Which returned:

    Fabric==0.9.3
    apache-libcloud==0.4.0
    bzr==2.3b4
    distribute==0.6.14
    docutils==0.7
    greenlet==0.3.1
    ipython==0.10.1
    iterpipes==0.4
    libxml2-python==2.6.21
    

    I say "surprisingly" because the package install tool is the exact place one would expect to find this functionality, although not under the name 'freeze' but python packaging is so weird, that I am flabbergasted that this tool makes sense. Pip 0.8.2, Python 2.7.

提交回复
热议问题