more Re: Peculiar ImportError traceback

Roman Suzi rnd at
Tue Sep 3 13:30:57 EDT 2002

On Tue, 3 Sep 2002, John J. Lee wrote:

BTW, I had something similar with different modules:

Python 2.2.1 (#1, May 21 2002, 09:12:04)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import email
>>> email.message_from_file(open("000.msg"))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/PIL/", line 35, in 
    # ;-)
  File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/", line 
41, in parse
  File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/", line 
134, in _parsebody
  File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/", line 
45, in parsestr
  File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/", line 
40, in parse
  File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/", line 
81, in _parseheaders
email.Errors.HeaderParseError: Not a header, not a continuation

- I have no idea why PIL/ is even mentioned here!
I am pretty sure email package can't depend on it in any way.

My sys.path is like:

>>> sys.path
['', '/usr/lib/python2.2', '/usr/lib/python2.2/plat-linux2', 
'/usr/lib/python2.2/lib-tk', '/usr/lib/python2.2/lib-dynload', 

Something is broken.
(the directory /var/tmp/python2-2.2.1-root doesn't exist)

>>>> from mx import DateTime
>*** You don't have the (right) mxDateTime binaries installed !
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "mx/DateTime/", line 8, in ?
>    from DateTime import *
>  File "mx/DateTime/", line 9, in ?
>    from mxDateTime import *
>  File "/usr/local/lib/python2.2/site-packages/reportlab/", line 13, in ?
>    myDir = os.path.split(__file__)[0]
>ImportError: No module named mxDateTime
>>>> from mx.DateTime import mxDateTime
>Two obvious problems:
>1. Bizarre last line of traceback involving reportlab (whose
> I list in full below).  Reportlab and mxDateTime, AFAIK,
>are entirely unrelated!
>2. mxDateTime's (mx/DateTime/mxDateTime/ does
>an import mxDateTime, which then fails, causing the error message
>about mxDateTime's binaries (ie. to be printed.
>Obviously, Python isn't finding the library, but I can't remember how
>extension modules are located, nor could I find anything in the Python
>docs on this -- could anyone point it out for me?
>Even better, explain why on earth I get that line about reportlab!  Up
>until now reportlab has sat in /usr/local/lib/python2.2/site-packages
>quietly minding its own business.  The egenix-mx-base `mx' directory
>(2.0.3) is also in the same site-packages directory.  Grepping through
>reportlab, I see that one of its demos making use of mxTextTools, but
>I don't think that's relevant.
>#copyright ReportLab Inc. 2000-2001
>#see license.txt for license details
>#$Header: /cvsroot/reportlab/reportlab/,v 1.16 2001/08/13 12:17:12 rgbecker Exp $
>__version__=''' $Id:,v 1.16 2001/08/13 12:17:12 rgbecker Exp $ '''
>__doc__="""The Reportlab PDF generation library."""
>Version = "1.09"
>def getStory(context):
>    if == 'UserGuide':
>        # parse some local file
>        import os
>        myDir = os.path.split(__file__)[0]
>        import yaml
>        return yaml.parseFile(myDir + os.sep + 'mydocs.yaml')
>    else:
>        # this signals that it should revert to default processing
>        return None

Sincerely yours, Roman Suzi
rnd at =\= My AI powered by Linux RedHat 7.2
aaro at <- not to be mailed to

More information about the Python-list mailing list