1

I installed python 2.6 on my mac (which ships with 2.5, and I am going crazy in working with 2.6) Everything has been installed on /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/. Now I want to install the python BerkeleyDB module, but it goes syntax error during the build:

creating build/temp.macosx-10.3-fat-2.6/extsrc
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DPYBSDDB_STANDALONE=1 -I~/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c extsrc/_bsddb.c -o build/temp.macosx-10.3-fat-2.6/extsrc/_bsddb.o
extsrc/_bsddb.c:232: error: syntax error before 'DB_ENV'
extsrc/_bsddb.c:232: warning: no semicolon at end of struct or union
extsrc/_bsddb.c:239: error: syntax error before '}' token
extsrc/_bsddb.c:239: warning: data definition has no type or storage class
extsrc/_bsddb.c:245: error: syntax error before 'DBEnvObject'
extsrc/_bsddb.c:245: warning: no semicolon at end of struct or union
extsrc/_bsddb.c:258: error: syntax error before '}' token
extsrc/_bsddb.c:258: warning: data definition has no type or storage class
<and so on>
extsrc/_bsddb.c:5915: error: 'DB_OLD_VERSION' undeclared (first use in this function)
extsrc/_bsddb.c:5916: error: 'DB_RUNRECOVERY' undeclared (first use in this function)
extsrc/_bsddb.c:5917: error: 'DB_VERIFY_BAD' undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/folders/Ye/YeXcn-oIE7ybm-TS4yB8c++++TQ/-Tmp-//cclJF2Xy.out

Google does not help.

4
  • Are you building BerkelyDB from a configure script? Commented Aug 20, 2009 at 2:41
  • I compiled berkeleydb from configure, as downloaded form oracle. Commented Aug 20, 2009 at 2:45
  • Sorry, I meant the module. What arguments to configure did you use? I think you need to modify the include path, i.e. something like --with-python=Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/. Commented Aug 20, 2009 at 3:11
  • The fact is that the compile line contains the proper path to the include dir. I'm trying with fink as you suggested. It's 5 in the morning here and I am rather annoyed. I have no interest in BDB at all, I just want to do an experiment with it. Commented Aug 20, 2009 at 3:17

6 Answers 6

2

The standard Python 2.6 installer for OS X from python.org includes bsddb. Why build your own?

Sign up to request clarification or add additional context in comments.

Comments

0

It may save you a lot of time to reinstall python using fink or macports, then get the berkley package from either.

1 Comment

macports is more comprehensive, I just mention fink so I'm not playing favorites.
0

Try:

easy_install bsddb3

Comments

0

Here's what I did for python2.5 easy_install didn't work for me

# get berkeley db
sudo port install db44

# download and untar bsddb3-4.8.1 and cd to the directory
sudo python setup.py --berkeley-db-incdir=/opt/local/include/db44 --berkeley-db-libdir=/opt/local/lib/db44 build

# test program test.py ran but don't know what it did
python test.py

# install
sudo python setup.py --berkeley-db-incdir=/opt/local/include/db44 --berkeley-db-libdir=/opt/local/lib/db44 install

# import as needed

Comments

0

I had a similar problem installing lxml. Try this for berkeleydb:

sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install bsddb3

Comments

0

For Mavericks/Yosemite (can use newer versions like db53 too):

sudo port install db51
sudo ln -sf /opt/local/include/db51/ /opt/local/lib/db51/include
sudo ln -sf /opt/local/lib/db51/ /opt/local/lib/db51/lib
sudo BERKELEYDB_DIR=/opt/local/lib/db51 ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install bsddb3

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.