[Tutor] .pth instead of PYTHONPATH

Dave S pythontut at pusspaws.net
Wed Nov 17 23:38:49 CET 2004


Dave S wrote:

> Hi all,
>
> I have several scripts that are in separate directories,  all under a 
> 'gg1.3' directory
> I am pleased with the scripts but I now need some scripts to import 
> others.
>
> I am working in '/home/dave/mygg/gg1.3/ftsd',  but I need to import 
> scripts from amongst others, /home/dave/mygg/gg1.3/logging where the 
> script logger.py lives
>
> So I have created 'paths.pth' which contains the line 
> '/home/dave/mygg/gg1.3/logging'
> & dropped it into '/home/dave/mygg/gg1.3/ftsd'
>
> When I execute ./ftsd, the line 'from logger import log' gives,
>
> bash-2.05b$ ./html_strip.py
> Traceback (most recent call last):
>  File "./html_strip.py", line 12, in ?
>    from logger import log
> ImportError: No module named logger
> bash-2.05b$
>
> In the past I have used PYTHONPATH successfully, can anyone tell me 
> where I am going wrong now ?
>
> Dave
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
Dope :-[ , put it in /usr/lib/python2.3/site-packages & all is well
Dave


More information about the Tutor mailing list