[Distutils] Given a distribution, find the Python modules (Was: finding a package namespace)

Éric Araujo merwok at netwok.org
Mon Sep 19 15:46:15 CEST 2011


Hi,

> I've been trying to deal with very simple question within python for weeks;
> http://stackoverflow.com/questions/7184375/how-to-find-import-name-of-any-package-in-python
What’s the use case?

> I modified the TokenMacGuy's code snippet a bit and put it on github;
You should be able to simplify that a bit, I’ll try to post something on
Stack Overflow later.

Here are some ideas:
- run setup.py install in a temp directory and detect modules
- run setuptools’ egg_info command and introspect one of the files it
creates

Cheers


More information about the Distutils-SIG mailing list