more Re: Peculiar ImportError traceback
Roman Suzi
rnd at onego.ru
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/__init__.py", line 35, in
message_from_file
# ;-)
File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/Parser.py", line
41, in parse
File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/Parser.py", line
134, in _parsebody
File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/Parser.py", line
45, in parsestr
File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/Parser.py", line
40, in parse
File "/var/tmp/python2-2.2.1-root/usr/lib/python2.2/email/Parser.py", line
81, in _parseheaders
email.Errors.HeaderParseError: Not a header, not a continuation
- I have no idea why PIL/__init__.py 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',
'/usr/lib/python2.2/site-packages',
'/usr/lib/python2.2/site-packages/Numeric',
'/usr/lib/python2.2/site-packages/PIL']
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/__init__.py", line 8, in ?
> from DateTime import *
> File "mx/DateTime/DateTime.py", line 9, in ?
> from mxDateTime import *
> File "/usr/local/lib/python2.2/site-packages/reportlab/__init__.py", 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
>__init__.py I list in full below). Reportlab and mxDateTime, AFAIK,
>are entirely unrelated!
>
>2. mxDateTime's __init__.py (mx/DateTime/mxDateTime/__init__.py) does
>an import mxDateTime, which then fails, causing the error message
>about mxDateTime's binaries (ie. mxDateTime.so) 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.
>
>
>John
>
>#copyright ReportLab Inc. 2000-2001
>#see license.txt for license details
>#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/__init__.py?cvsroot=reportlab
>#$Header: /cvsroot/reportlab/reportlab/__init__.py,v 1.16 2001/08/13 12:17:12 rgbecker Exp $
>__version__=''' $Id: __init__.py,v 1.16 2001/08/13 12:17:12 rgbecker Exp $ '''
>__doc__="""The Reportlab PDF generation library."""
>Version = "1.09"
>
>def getStory(context):
> if context.target == '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 onego.ru =\= My AI powered by Linux RedHat 7.2
aaro at onego.ru <- not to be mailed to
More information about the Python-list
mailing list