import module name collision

Chris Foote chris at foote.com.au
Sat Sep 4 10:13:41 EDT 2004


Today I happened to accidentally name one of my project's
files 'email.py', which collides with the module of the
same name in Python's standard library:

	from email.MIMEText import MIMEText

which causes problems within MIMEText later:

   File "/usr/lib/python2.3/smtplib.py", line 49, in ?
     from email.base64MIME import encode as encode_base64
ImportError: No module named base64MIME

Is there any mechanism to refer to standard library
modules so that there's no name collision problem with
the local filename ?

... or any other solution ?

Cheers,
Chris



More information about the Python-list mailing list