Suggestion for improved ImportError message
Benjamin
musiccomposition at gmail.com
Fri Aug 15 22:58:28 EDT 2008
On Aug 13, 3:55 pm, Kent Tenney <kten... at gmail.com> wrote:
> Howdy,
>
> I was just bit by
>
> from image import annotate
>
> ImportError: cannot import name annotate
>
> I found the problem via
>
> import image
> print image.__file__
>
> which made it clear that the wrong image module had been found.
>
> It would be nice if ImportError announced this up front.
Why? It says the file where the error originated in the traceback.
>
> cannot import name annotate from /usr/<snip>/image.pyc
>
> Thanks,
> Kent
More information about the Python-list
mailing list