Installing Bsddb Package - Python
Solution 1:
bsddb is deprecated since 2.6. The ideal is to use the bsddb3 module.
My suggestion, and by far the easiest option, is to install Homebrew and use it to get BerkeleyDB on your system:
brew install berkeley-db
After this install bsddb3 using pip
pip install bsddb3
or download the source and install normally.
python setup.py install
Solution 2:
I had a similar issue but none of the suggestions worked for me as I couldn't use AGPL license or a commercial Berkeley license from Oracle.
BERKELEYDB_DIR=$(brew --cellar)/berkeley-db/6.1.26 pip install bsddb3
Collecting bsddb3
Using cached bsddb3-6.1.1.tar.gzComplete output from command python setup.pyegg_info:
Trying to use the BerkeleyDB you specified...
DetectedBerkeleyDB version 6.1from db.h
******* COMPILATIONABORTED *******
You are linking a BerkeleyDB version licensed under AGPL3 or have a commercial license.
AGPL3 is a strong copyleft license and derivative works must be equivalently licensed.
You have two choices:
1.If your code is AGPL3 or you have a commercial BerkeleyDB license fromOracle, please, define the environment variable 'YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION' to any value, and try to install this python library again.
2.Inany other case, you have to link to a previous version ofBerkeleyDB. RemoveBerlekeyDB version 6.x and letthis python library try to locate an older version of the BerkeleyDB library in your system. Alternatively, you can define the environment variable 'BERKELEYDB_DIR', or 'BERKELEYDB_INCDIR' and 'BERKELEYDB_LIBDIR', with the path of the BerkeleyDB you want to use and try to install this python library again.
Sorryfor the inconvenience. I am trying to protect you.
Moredetails:
https://forums.oracle.com/message/11184885http://lists.debian.org/debian-legal/2013/07/
******* COMPILATIONABORTED *******
However reverting to an older version fixed it.
Install the older version of berkeley-db with brew
brew install berkeley-db4
Then as suggested install bsddb3 with pip
pip install bsddb3
Then
BERKELEYDB_DIR=$(brew --cellar)/berkeley-db4/4.8.30 pip install bsddb3
(modified from Stefan Schmidt's comment to reference the older berkeley-db version directory)
Finally apply patch to dbhash.py as described here.
Solution 3:
@bamdan 's answer uses an older version of Berkeley DB, if you still want to use the latest, Berkeley DB,
First, install the latest Berkeley DB
pip install berkeley-db
Second, set an environment variable
YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION
to indicate that you have the licenseBERKELEYDB_DIR=$(brew --cellar)/berkeley-db4/6.1.26YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION=yes pip install bsddb3
Solution 4:
I just wanted to add something that is currently missing, I'm a Linux Ubuntu/Debian user, but I have to make my python scripts work on macOS systems. I encountered the same issue that user1611830 encountered.
I followed the steps explained by Francisco Roque and Sean above. However, I was obtaining the same initial problem. I saw Bamdan's answer and wanted to see the patch he referred to modify dbhash.py using the link he provided source. But the 'patch' link is no longer working.
I found out that in order to modify dbhash.py as explained in source, one needs to disable the System Integrity Protection, so followed the instructions of this answer disablingSIP. Afterward, I could modify dbhash.py and the new bsddb3 worked and I could use shelve to read in workspaces saved previously.
Post a Comment for "Installing Bsddb Package - Python"