[New-bugs-announce] [issue12583] More detailed `ImportError` messages

Ram Rachum report at bugs.python.org
Mon Jul 18 22:45:33 CEST 2011


New submission from Ram Rachum <cool-rr at cool-rr.com>:

I've been frustrated so many times by `ImportError: cannot import name foo`. Right now I'm debugging some problem on a PAAS server (with no SSH access), and the server returns a traceback of `cannot import name foo`, and I don't have any idea what it means. It could mean that the file isn't there. It could mean that there's a circular import problem. Sometimes it happens when you go over Windows XP's path length limit!

Please provide a useful explanation, like this:

    ImportError: Cannot import `foo` because no file foo.py* or folder foo exists.
    ImportError: Cannot import foo module because no __init__.py* file exists in the foo folder.
    ImportError: Cannot import foo because of a circular import problem with bar.
    ImportError: Cannot import foo because the foo module file's path is bigger than Windows XP's path length limit.

Etcetera for any other reason that might cause an `ImportError`.

----------
components: Interpreter Core
messages: 140614
nosy: cool-RR
priority: normal
severity: normal
status: open
title: More detailed `ImportError` messages
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12583>
_______________________________________


More information about the New-bugs-announce mailing list