2009-08-20 12 views
1

私のMacにPython 2.6がインストールされています(2.5が同梱されていますが、私は2.6で作業することに夢中です)すべてが/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/にインストールされています。今度はPython BerkeleyDBモジュールをインストールしたいが、ビルド中に構文エラーが発生する。osxに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 

Googleは役に立ちません。

+0

あなたはconfigureスクリプトからBerkelyDBを構築しているの? –

+0

ダウンロードしたフォームoracleとしてberkeleydbをconfigureからコンパイルしました。 –

+0

申し訳ありませんが、私はモジュールを意味しました。設定するにはどのような引数を使用しましたか? '--with-python = Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 /'のようなインクルードパスを変更する必要があると思います。 –

答えて

0

finkやmacportsを使ってPythonを再インストールしてから、berkleyパッケージを入手する時間を節約するかもしれません。

+0

macportsはより包括的です、私はお気に入りを演奏していないので、ちょうどfinkを言います。 –

2

python.orgの標準のPython 2.6インストーラには、bsddbが含まれています。なぜ自分でビルドするのですか?

0

試してみてください。

easy_installをbsddb3

0

は、ここで私はlxmlをインストール同様の問題があったの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

を働かなかったため、私がやったことです。 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 
関連する問題