473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

import logging fails on MacPython 2.4.3

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 <to*@uchicago.edu>
Programmer/Analyst
University of Chicago Library
Aug 9 '06 #1
2 1831
Tod Olson schrieb:
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/
On my machine, that is
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/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

Which is wrong - you'd have to add the path without the logging part!

Diez
Aug 9 '06 #2
Diez B. Roggisch wrote:
Tod Olson schrieb:
>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/

On my machine, that is
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/logging
That's good to hear, as it agrees with the other Python installations
I've examined. That locations makes much more sense than where it landed
on my machine.
>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


Which is wrong - you'd have to add the path without the logging part!
Great, thanks!

-Tod
Aug 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Manlio Perillo | last post by:
Hi. I'm a new user of Python but I have noted a little problem. Python is a very good language but it is evolving, in particular its library is evolving. This can be a problem when, ad example,...
0
by: plb | last post by:
All: I am struggling with an import problem... In my package, myapp, there is a module called logging. This module, naturally, imports the standard library module logging. However, when I...
4
by: Paul Miller | last post by:
I have a user who is is having trouble getting MacPython on his OS X 10.3.8 system. When he runs ConfigurePythonCarbon, he gets this error: 'import site' failed; use -v for traceback...
0
by: skip | last post by:
After much wailing and gnashing of teeth the past couple of days, I managed to move (most of?) the content from the MacPython wiki to the main Python wiki (*). All pages were created as subpages...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.