Suggestion for improved ImportError message

Kent Tenney ktenney at gmail.com
Wed Aug 13 22:55:38 CEST 2008


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.

cannot import name annotate from /usr/<snip>/image.pyc

Thanks,
Kent




More information about the Python-list mailing list