[Tutor] can't import module

Dave Kuhlman dkuhlman at rexx.com
Sun Jul 2 18:02:26 CEST 2006


On Sun, Jul 02, 2006 at 11:55:24AM +0100, Dave S wrote:

[snip]
> 
> Thanks for replying :)
> 
> The app is fairly big and distributed around the gg1.4 directory. I get the 
> feeling that 'from logger import log' is the first of a lot of import 
> problems, this script alone imports from another 7 modules
> 
> from urllib import urlopen
> from time import strftime
> from cPickle import dump
> from datetime import datetime, time, timedelta
> from os import remove
> 
> from logger import log
> from html_strip import html_strip
> from garbage_collect import garbage_collect
> from valid_day import valid_day
> from exact_sleep import sleep_delay,sleep_until
> from cookie_string import cookie_string
> from data_core import Data_Core
> 
> from config import data_dir,HTML_addr, ipc_dir
> 

So, ask yourself:  Where is logger.py?  Modules logger,
html_strip, etc are not it the Python standard library (see:
http://docs.python.org/lib/lib.html).  Are they in your
application?  Are (were) they in some package that you had
previously installed (but that needs to be re-installed)?

One possible explanation for your problem is that when you
upgraded from Ubuntu/Kubuntu breezy to dapper, you also upgraded
from Python 2.3 to Python 2.4.  If so, Python is now importing
from:

    /usr/lib/python2.4/site-packages/

instead of:

    /usr/lib/python2.3/site-packages/

If so, there might be Python modules that need to be re-installed
by running Python 2.4 (instead of Python 2.3).  I know that on my
Kubuntu system, there is both Python 2.4 and 2.3.

If the above is *not* the problem, then you need to find out where
your application used to find these modules (e.g. logger).  That
will help you (or someone on this list) figure out how to enable
Python and your live_datad.py application to find them.

Hope this helps.

Dave K.

[snip]

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman


More information about the Tutor mailing list