I ran into a custom installed python 2.7 on OS X. It required X11 to list modules installed (both using help and pydoc).
To be able to list all modules without installing X11 I ran pydoc as http-server, i.e.:
pydoc -p 12345
Then it's possible to direct Safari to http://localhost:12345/
to see all modules.