import module name collision

Robert Brewer fumanchu at
Sat Sep 4 20:17:33 CEST 2004

Chris Foote wrote:
> Today I happened to accidentally name one of my project's
> files '', 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/", 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 ?

I assume your '' is either in /Lib or in /site-packages...? The
quickest solution would be to make your project into a package and shove
your '' into it somewhere, so it's no longer 'top-level'.

Robert Brewer
Amor Ministries
fumanchu at

More information about the Python-list mailing list