0

OS Windows XP SP3

situation

I installed three python exes on my machine.

  1. Python 2.6
  2. Python 2.7
  3. Python EPD ENABLED (for pylab)

problem

I installed wxPython and in the selection I decided to install it to Python in system registry

I don't know to which python this package was installed.

what I tried

I tried writing import wx on all the shells and found that it was installed to EPD python.

bigger issue

I don't want to keep doin this each time I install a package. So is there a command that can be used in the shell or any other way, so that I can know about all the packages installed?

please help me with this issue.

IcyFlame
  • 5,059
  • 21
  • 50
  • 74

2 Answers2

1

Type help() in the shell. And then in the help prompt type modules to see a complete list of all modules.

IcyFlame
  • 5,059
  • 21
  • 50
  • 74
1

You can get a complete list with sys.builtin_module_names and pkgutil.walk_packages():

import pkgutil
import sys

print sys.builtin_module_names + [name for module_loader, name, ispkg in pkgutil.walk_packages()]

The modules subcommand of help() puts a friendlier interface on top of these results.

Michael Hoffman
  • 32,526
  • 7
  • 64
  • 86