[New-bugs-announce] [issue3619] A more informative message for ImportError

Kent Tenney report at bugs.python.org
Wed Aug 20 16:00:34 CEST 2008

New submission from Kent Tenney <ktenney at gmail.com>:

from foo import bar
ImportError: cannot import name bar

The error may be due to the wrong 'foo' being found, some investigation
is required.

If the the ImportError message included the filename for 'foo', the
problem would be obvious.
ImportError cannot import name bar from  /usr/lib/<snip>/foo.pyc

A c.l.p. thread on this is at

a patch from Wojtek Walczak is here and attached

a thread about it on python-dev is here

including a comment on the patch

components: None
files: from-import-py2.5.1.patch
keywords: patch
messages: 71542
nosy: ktenney
severity: normal
status: open
title: A more informative message for ImportError
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file11173/from-import-py2.5.1.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list