◐ Shell
clean mode source ↗

Message 63993 - Python tracker

Try this to reproduce error:

$ mkdir -p test/email
$ cd test
$ touch __init__.py email/__init__.py
$ cat <<! > foo.py
from __future__ import absolute_import
import smtplib
!
$ python
>>> import foo
...
  File "/usr/lib/python2.6/smtplib.py", line 46, in <module>
    import email.utils
ImportError: No module named utils

If you rename the email subdirectory, it will find email.utils where it
should find it.

Strangely, this doesn't happen if you have an 'os' subdirectory and try
to import shlex, which does: import os.path ??