[Tutor] can't import module
Dave S
pythontut at pusspaws.net
Sun Jul 2 21:29:09 CEST 2006
On Sunday 02 July 2006 18:48, Dave Kuhlman wrote:
> On Sun, Jul 02, 2006 at 10:32:51AM -0700, Danny Yoo wrote:
> > > PYTHONPATH=/home/dave/my_files/my_gg/gg1.4/configs:/home/dave/my_files/
> > >my_gg/gg1.4/logs:/home/dave/my_files/my_gg/gg1.4/get_data:/home/dave/my_
> > >files/my_gg/gg1.4/gg_utils:/home/dave/my_files/my_gg/gg1.4/ipc:/home/dav
> > >e/my_files/my_gg/gg1.4/process_data:/home/dave/my_files/my_gg/gg1.4/comm
> > >on_utils:/home/dave/test2
> >
> > Have you marked PYTHONPATH to be exportable? Your shell may not do this
> > automatically unless explicitely told to do so.
>
> A simple test -- In order to check PYTHONPATH do the following:
>
> $ python
> Python 2.4.3 (#1, Apr 11 2006, 20:59:32)
> [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import sys
> >>> print sys.path
>
> Dave K.
Thank you also. inadvertently I think you have given me the key to another
problem that has been bugging me for a couple of weeks to do with paths and
library's a python app accesses.
['', '/home/dave/my_files/my_gg/gg1.4/configs', '/home/dave/my_files/my_gg/gg1.4/logs', '/home/dave/my_files/my_gg/gg1.4/get_data', '/home/dave/my_files/my_gg/gg1.4/gg_utils', '/home/dave/my_files/my_gg/gg1.4/ipc', '/home/dave/my_files/my_gg/gg1.4/process_data', '/home/dave/my_files/my_gg/gg1.4/common_utils', '/home/dave/test2', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/HTMLgen', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/cairo', '/usr/lib/python2.4/site-packages/gst-0.10', '/usr/lib/python2.4/site-packages/gtk-2.0']
One question, where is the rest of PYTHONPATH defined, my section in .bashrc
is only the first part, where do you get to define the /usr/lib part ?
Dave
More information about the Tutor
mailing list