[Distutils] `pkg_resources.require()`doesn’t see wxPython

Tarek Ziadé ziade.tarek at gmail.com
Sat Nov 14 19:00:33 CET 2009


On Sat, Nov 14, 2009 at 2:46 PM, Ram Rachum <cool-rr at cool-rr.com> wrote:
[..]
>
> I haven't investigated that egg-info thing, because it doesn't matter much to me
> what is the technical reason for this. The fact that `require` gave a false
> positive, and not even under any special circumstances, just a standard Windows
> installation of wxPython, is reason enough not to use it in my project.

What is your Python version ? Starting at Python 2.5, all
distutils-based installers add an egg-info
file or folder alongside the packages it installs in your system.

If it's not present it could be a partial installation, or a bug. I
would be interested in your feedback
if you do investigate some more.


>
> Also, before I came to this conclusion I noticed the kind of error that
> pkg_resources raises:
>
>    pkg_resources.DistributionNotFound: my-dependency
>
> That is not too helpful. Yes, I noticed you have a todo comment on that error to
> make it more informative:
>
>    raise DistributionNotFound(req)  # XXX put more info here
>
> So here's a patch for you:
>
>    raise DistributionNotFound('''The distribution %s is needed for this \
> program, but it was not found on this system. Please search for it on the \
> internet, then download and install it, then try this program again.''' % req)
>
> Because when a potential user has just downloaded my program and he's trying it
> out, the last thing I want to do is scare him away with an obscure error
> message.

Sure, that's helpfull. I am adding this in Distribute, for the 0.6.9
upcoming release.

Tarek


More information about the Distutils-SIG mailing list