import logging fails on MacPython 2.4.3

Tod Olson tod at uchicago.edu
Wed Aug 9 00:22:09 EDT 2006


Anyone have advice for importing the logging module using MacPython 2.4.3?

MacPython installs the logging module in:

/Library/Frameworks/Python.framework/Versions/2.4/lib/logging/

There's an __init__.py there and everything, but this directory is not
in sys.path. I add it to sys.path as follows:

 >>> sys.path.append(os.path.join(sys.prefix, 'lib', 'logging'))
 >>> print sys.path[-1]
/Library/Frameworks/Python.framework/Versions/2.4/lib/logging

But even so, the logging module is not found:

 >>> import logging

Traceback (most recent call last):
   File "<pyshell#7>", line 1, in -toplevel-
     import logging
ImportError: No module named logging

Now, I've been away from Python for some years, so I'm pretty rusty.
Maybe there's something obvious I'm missing. Any advice on how to
proceed would be welcome.

Tod Olson <tod at uchicago.edu>
Programmer/Analyst
University of Chicago Library



More information about the Python-list mailing list