[Distutils] pkg_resources get Distribution by module name

Tarek Ziadé ziade.tarek at gmail.com
Sun Jan 3 21:28:19 CET 2010

On Sun, Jan 3, 2010 at 1:14 PM, anatoly techtonik <techtonik at gmail.com> wrote:
> Hello,
> If there any way to get Distribution information given the module name
> like 'trac.admin.web_ui'  in setuptools?
> There is a problem to extract information about exact distribution
> name and version when module is already imported in application (Trac
> plugins).

I am not sure exactly what you are trying to do, but :

If your trac plugin was done using entry points (as it says at
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment), this means
that you can
use the iter_entry_points API from pkg_resources: You will get a
EntryPoint object that contains a dist attribute, pointing to the
distribution infos.

> Thanks.
> --
> anatoly t.
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

Tarek Ziadé | http://ziade.org

More information about the Distutils-SIG mailing list