Peculiar ImportError traceback

John J. Lee jjl at
Tue Sep 3 12:56:57 EDT 2002

>>> 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')
        # this signals that it should revert to default processing
        return None

More information about the Python-list mailing list