2009-08-20 190 views
1

蟒蛇的BerkeleyDB訪問我安裝的Python 2.6在我的Mac(附帶的2.5,而我在工作的2.6要瘋了)一切都已經安裝上/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/。現在我想安裝python BerkeleyDB模塊,但它在構建過程中出現語法錯誤:無法安裝在OSX

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無法幫助。

+0

你從配置腳本構建BerkelyDB? – 2009-08-20 02:41:08

+0

我從configure中編譯了berkeleydb,就像下載的oracle一樣。 – 2009-08-20 02:45:59

+0

對不起,我的意思是模塊。你用什麼參數來配置?我認爲你需要修改包含路徑,例如'--with-python = Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 /'。 – 2009-08-20 03:11:49

回答

0

它可以爲您節省大量的時間來重新安裝使用fink或MacPorts的蟒蛇,然後要麼得到伯克利包。

+0

macports更全面,我只是提到fink,所以我不玩最喜歡的。 – 2009-08-20 03:05:04

2

python.org的OS X的標準Python 2.6安裝程序包括bsddb。爲什麼建立自己的?

0

嘗試:

的easy_install bsddb3

0

這裏就是我做了的python2.5的easy_install沒有工作對我來說

# 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 
0

我有一個類似的問題在安裝lxml。嘗試一下本作的BerkeleyDB:

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

對於小牛/優勝美地(可以使用新版本像db53太):

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