[Tutor] import'ing problems (path)

Kent Johnson kent_johnson at skillsoft.com
Tue Oct 5 20:45:37 CEST 2004


It looks like WebKit doesn't want to see the Webware level in the package 
hierarchy. You could take everything out of the Webware directory and put 
it directly in site-packages or add the Webware directory to sys.path as I 
described before. Then try import WebKit.Page (without the WebWare prefix).

You might have better luck with this on the Webware mailing list.

Kent

At 10:29 AM 10/5/2004 -0800, Tim Johnson wrote:
>* Kent Johnson <kent_johnson at skillsoft.com> [041005 05:10]:
> > Tim,
> >
>   Hi Kent:
> > Did you run the WebWare installer or just unpack the distribution file?
>
>   I ran the Webware installer, it did not appear to copy files
>   elsewhere.
> > Usually third-party libraries are installed in Python/lib/site-packages.
>
>   So... I reinstalled, by unpacking to
>   /usr/local/lib/python2.3/site-packages/Webware,
>   then ran the webware installer again, said installation was
>   successful.
>
>   Now, Page.pyc is at
>   /usr/local/lib/python2.3/site-packages/Webware/WebKit
>   Now, if I code:
>   import Webware.WebKit ## and stop the program here, there is no
>                         ## ImportError exception thrown
>   If I code
>   import Webware.WebKit.Page
>   ## I get the ImportError: "No module named MiscUtils"
>   MiscUtils is a directory at the same level ast WebKit.
>
>   Not sure where to go from here.......
>   whew!
>   tim
>
> > This directory is automatically added to sys.path.
> >
> > Alternatively you can make a permanent, global modification to sys.path by
> > creating a file
> > Python/lib/site-packages/sitecustomize.py
> > containing the two lines
> > import sys
> > sys.path.append('/home/tim/downloads/python/Webware-0.8.1')
>
>--
>Tim Johnson <tim at johnsons-web.com>
>       http://www.alaska-internet-solutions.com
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list