Suggestion for improved ImportError message

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


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


More information about the Python-list mailing list