[newbie] import fails first time, then works :-[

Peter Hansen peter at engcorp.com
Fri Jun 21 21:21:08 EDT 2002


laotseu wrote:
> 
> Well... I added '/usr/local/lib/lib-dynload' to my PYTHONPATH and
> 'import' does not complain anymore. Everything seems just fine now. But
> that is puzzling me ! [being a python newbie,] I thought the
> '/lib-dynload/' directorie, that is in the '/lib/python<version>/'
> directories, was automagically searched for external modules. Was I wrong ?

Searching the executable with "strings" and "grep", I find references
to /usr and /lib/python2.0 (in my case) and both /lib/lib-dynload 
and /lib-dynload.  When I run python and check sys.path I get

['', '/usr/bin', '/usr/lib/python2.0', '/usr/lib/python2.0/plat-linux2', 
'/usr/lib/python2.0/lib-tk', '/usr/lib/python2.0/lib-dynload', 
'/usr/lib/python2.0/site-packages'] 

All with default values, under RedHat 7.1.  Not sure why you've
got troubles... Linux is still Black Magic much of the time to me. :)

-Peter



More information about the Python-list mailing list