Error setting sys.path & friends on RedHat Linux 5.2, Python 1.5.1?

Skip Montanaro skip at mojam.com
Mon May 10 16:59:30 EDT 1999


I recently upgraded to RedHat 5.2.  It comes with Python 1.5.1 in
/usr/bin.  Coincidentlly, I have Python 1.5.1 installed in
/usr/local/bin, with all the attendant directories in /usr/local/lib.  I
don't want to mix the two so as not to break anything the RH folks might
rely on.

Python seems to be mixing things nonetheless, and this is giving me
fits.  I have a simple script that procmail calls to look up addresses
in a bsddb database.  The bsddb module is not installed as part of
RedHat's version, but I have it in my version.  When my script executes
it gets an ImportError:

  Traceback (innermost last):
    File "/home/dolphin/skip/cmd/chkmail", line 11, in ?
      import sys, bsddb, regsub, os, stat, string, socket
  ImportError: No module named bsddb

That seemed odd to me since I explicitly ask for my version of Python at
the top of my script:

  #!/usr/local/bin/python

I added a couple prints of sys module elements to the script.  This is
what got printed for various items:

version:        1.5.1 (#61, May  5 1999, 09:00:36)  [GCC 2.7.2.3]
path:   	['/home/dolphin/skip/cmd', '/usr/lib/python1.5/',
		 '/usr/lib/python1.5/test', '/usr/lib/python1.5/plat-linux2',
		 '/usr/lib/python1.5/lib-tk', '/usr/lib/python1.5/lib-dynload']
prefix: 	/usr
exec_prefix:    /usr
executable:     /usr/bin/python

/usr/bin/python prints #1 for the build number:

  Python 1.5.1 (#1, Sep  3 1998, 22:51:17)

while my version prints build number 61.  It's evident that my version
is getting executed, but everything else is wrong.  Is this a known
1.5.1 problem?  If so, is it fixed in 1.5.2?

--
Skip Montanaro	| Mojam: "Uniting the World of Music"
http://www.mojam.com/
skip at mojam.com  | Musi-Cal: http://www.musi-cal.com/
518-372-5583




More information about the Python-list mailing list