3

For example, in rails you can do a 'gem list' and it will show all of the gems that you have installed.

Any clue how I can do this in python? Also, I am using virtualenv, not sure if that helps?

Kamilski81
  • 14,409
  • 33
  • 108
  • 161

4 Answers4

6
help('modules')

is supposed to do it (from here).

Note: When I did it, I got a segmentation fault due to one of the libraries (I'm on Ubuntu).

Community
  • 1
  • 1
John Doe
  • 3,436
  • 1
  • 18
  • 21
4

This question is answered here:

help('modules') in a Python prompt, or pydoc modules in a regular shell.

Community
  • 1
  • 1
NicolasP
  • 765
  • 3
  • 9
4

Since there are many ways.

You can try module yolk

easy_install yolk or pip install yolk

and list installed modules using

yolk -l

It's far more powerful. It can also allow you too check for updates. See the documentation for details. I have been using this package a lot.

yolk -U

pyfunc
  • 65,343
  • 15
  • 148
  • 136
3

Install pip and do pip freeze.

If you are using virtualenv, it is already installed in it.

lig
  • 3,567
  • 1
  • 24
  • 36
  • Another solution that works. It should be noted though that this also catches all globally installed modules as well. Depending on what the author wants, this could be bad/good (he may only want to list virtualenv installed modules, although that's as easy as going into the virtualenv site-packages folder). – John Doe Dec 09 '11 at 20:46
  • Actualy you should read about `pip` http://www.pip-installer.org/en/latest/index.html if you are going to get benefits of using virtualenv. – lig Dec 09 '11 at 20:46
  • 1
    @JohnDoe under virtualenv configured with --no-site-packages it will show only packages installed in this virtualenv. – lig Dec 09 '11 at 20:47
  • True. It all depends on the virtualenv configuration in such a case. :) – John Doe Dec 09 '11 at 20:50
  • Starting from pip 1.3 there's a [list](http://www.pip-installer.org/en/latest/usage.html#pip-list) command. – Piotr Dobrogost Mar 13 '13 at 21:57