1 Reply Latest reply on Feb 29, 2012 2:13 AM by JesúsCea

    BerkeleyDB.4.4 + Python 2.7 + bsddb3

      Hello ,i had to built a machine for a customer that requested me to install BerkeleyDB.4.4 on redhat , since the gcc version that redhat comes is different than they want to use i installed the compat librarie and built is running the following command:

      env CC=/usr/bin/gcc44 CXX=/usr/bin/g++44 ./configure ...

      After that i compiled Python2.7 and now they requested me to install bsddb3 , after i installed that they wanted to load the bsddb module but it was failing so i installed python-devel from redhat and ran the setup again for bsdbb3.

      bsddb module still fails but i can load bsddb3 module:

      []# python
      Python 2.7.2 (default, Jan 3 2012, 17:01:49)
      [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      import bsddb3
      (4, 4, 20)

      The problem is they are trying to run a script and that fails with the following message

      Traceback (most recent call last):
      File "dump-actors.py", line 4, in <module>
      import SPackedFS
      File "/path/SPackedFS.py", line 3, in <module>
      import bsddb, sys, codecs, struct, os, random, re, string
      File "/usr/local/lib/python2.7/bsddb/__init__.py", line 67, in <module>
      import _bsddb
      ImportError: No module named _bsddb

      so they changed the script to use bsddb3 and they get this error:

      Traceback (most recent call last):
      File "dump-actors.py", line 64, in <module>
      pfs = SPackedFS.PackedFS(index)
      File "/path/SPackedFS.py", line 50, in __init__
      self.db = bsddb3.btopen(db_file)
      File "/usr/local/lib/python2.7/site-packages/bsddb3/__init__.py", line 379, in btopen
      d.open(file, db.DB_BTREE, flags, mode)
      bsddb3.db.DBNoSuchFileError: (2, 'No such file or directory')

      Im not sure how to continue with this issue, any help would be really appreciated...Thanks in advance
        • 1. Re: BerkeleyDB.4.4 + Python 2.7 + bsddb3
          I solved related bugs in pybsddb 5.1.2:

          "Since 5.0.0, we can't find 4.x libraries unless we specify a "--berkeley-db=/path/to/bsddb" option. Reported by Wen Heping. "

          "5.1.1 install fails if the bsddb in the standard library is not installed, under Python 2.7. Reported by Arfrever Frehtes Taifersar Arahesis. "

          Please, use last pybsddb, currently 5.3.0: http://www.jcea.es/programacion/pybsddb.htm