Shelve Help!

Catriona Johnston kjohnston at rcsi.ie
Mon Aug 21 04:55:03 EDT 2000


Dear All,
	I am afraid I have a problem that I cannot solve and was wondering
if anyone could help. I am working on Red Hat Linux 6.1. I have been trying
to use the shelve module, but am getting an error stating that no dbm can be
found. 
error:
Traceback (most recent call last):
		File "/users/kjohnston/programs/sequence.py", line 83, in ?
    		    main()
 		File "/users/kjohnston/programs/sequence.py", line 69, in
main
		    seq.store()
		File "/users/kjohnston/programs/sequence.py", line 36, in
store
		    db = shelve.open('DataBase', 'w')
		File "/usr/local/lib/python1.6/shelve.py", line 157, in open
		    return DbfilenameShelf(filename, flag)
  		File "/usr/local/lib/python1.6/shelve.py", line 147, in
__init__
		    Shelf.__init__(self, anydbm.open(filename, flag))
		File "/usr/local/lib/python1.6/anydbm.py", line 83, in open
		    raise error, "db type could not be determined"
		anydbm.error: db type could not be determined
I have managed to narrow the problem down somewhat...there is no dbm module
nor any other type when I check in the python interpreter (apart from
dumbdbm but shelve does not seem to want to use it). So I went to reinstall
Python1.6 to include these modules. I altered the Modules/Setup file to
include them, ran make clean and then ./configure --enable-gcc and then
make. However when I ran make I got an error saying that I do not have the
following file: ndbm.h. I ran a search for this file and located it in the
following places:
/usr/include/db1/ndbm.h
/usr/glibc-2.1.3.orig/glibc-2.1.3/db/ndbm.h
/glibc-2.0/db/ndbm.h

how do I tell make that the ndbm.h is present at these locations? 
thanks again!
kate




More information about the Python-list mailing list