无法在OSX上安装Python berkeleydb访问

1 投票
6 回答
1377 浏览
提问于 2025-04-15 13:44

我在我的Mac上安装了Python 2.6(系统自带的是2.5,我在用2.6的时候快要疯了)。所有的东西都安装在/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/这个地方。现在我想安装Python的BerkeleyDB模块,但在构建的时候出现了语法错误:

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

谷歌也没办法解决这个问题。

6 个回答

0

试试这个:

easy_install bsddb3

2

python.org 下载的标准 Python 2.6 安装包已经包含了 bsddb。那为什么还要自己去编译一个呢?

0

如果你用fink或macports重新安装Python,可能会节省你很多时间,然后再从这两个工具中获取berkley包。

撰写回答