How to Fix the Broken BSDDB Install in the Default Python Package on Mac OS X 10.5 Leopard?

为君一笑 提交于 2019-12-01 07:38:07

This pain persists on OSX 10.8. I could not install bsddb3 using macports py-bsddb3 into a virtualenv. What was very simple and did work is:

  • install db53 from macports
  • download and unpack bsddb3 source (https://pypi.python.org/pypi/bsddb3/6.1.0)
  • sudo python setup.py –berkeley-db-incdir=/opt/local/include/db53 –berkeley-db-libdir=/opt/local/lib/db53 install

The patch did not work for me and I had to replace the bsddb folder in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

with the bsddb3 in:

/usr/local/lib/python2.7/site-packages/bsddb3

Make sure you backup the bsddb folder just in case.

A solution I found was to install ActivePython, dig into its library (located in /Library/Frameworks/Python.framework/Versions/....your version here..../lib) and copy and paste the _bsddb.so file into my OS X 10.6 native python 2.6 install directory (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/).

That fixed the missing _bsddb issue leaving me with a working version of bsddb in my native python install. Then, I just uninstalled ActivePython (instructions here)

The error I had was "No module named _bsddb". It turn out I didn't need to upgrade my bsddb. I wasusing the .pkl file created in windows. After renaming the pkl file to get it out the way Mac OSX Python recreated a new .pkl.db file and now it works perfectly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!