Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在osx上安装python berkeleydb access_Python_Macos - Fatal编程技术网

无法在osx上安装python berkeleydb access

无法在osx上安装python berkeleydb access,python,macos,Python,Macos,我在我的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 /Develo

我在我的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
创建build/temp.macosx-10.3-fat-2.6/extsrc
gcc-arch-ppc-arch-i386-isysroot/Developer/SDKs/MacOSX10.4u.sdk-fno严格别名-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:DB_ENV之前的语法错误
extsrc/_bsddb.c:232:警告:在结构或联合的末尾没有分号
extsrc/_bsddb.c:239:错误:“}”标记前面的语法错误
extsrc/_bsddb.c:239:警告:数据定义没有类型或存储类
extsrc/_bsddb.c:245:错误:“DBEnvObject”之前的语法错误
extsrc/_bsddb.c:245:警告:在结构或联合的末尾没有分号
extsrc/_bsddb.c:258:错误:“}”标记前面的语法错误
extsrc/_bsddb.c:258:警告:数据定义没有类型或存储类
extsrc/_bsddb.c:5915:错误:“DB_OLD_VERSION”未声明(首次在此函数中使用)
extsrc/_bsddb.c:5916:错误:“DB_RUNRECOVERY”未声明(首次在此函数中使用)
extsrc/_bsddb.c:5917:错误:“DB\u VERIFY\u BAD”未声明(首次在此函数中使用)
lipo:无法确定:/var/folders/Ye/YeXcn-oIE7ybm-TS4yB8c+++TQ/-Tmp-//cclJF2Xy.out的体系结构类型

谷歌没有帮助。

使用fink或macports重新安装python,然后从其中任何一个获得berkley软件包,可能会为您节省大量时间。

标准的python 2.6 OS X安装程序包含bsddb。为什么要建立自己的

试试看:


easy_install bsddb3

以下是我为python2所做的工作。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

我在安装
lxml
时遇到了类似的问题。请为伯克利DB尝试以下内容:

sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install bsddb3
对于Mavericks/Yosemite(也可以使用更新版本,如db53):


您是从配置脚本构建BerkelyDB吗?我是从配置中编译BerkelyDB的,从oracle下载的。对不起,我指的是模块。您使用了哪些要配置的参数?我认为您需要修改include路径,例如使用python=Library/Frameworks/python.framework/Versions/2.6/include/python2.6/修改include路径。事实上,编译行包含正确的include目录路径。我正按照你的建议和芬克一起尝试。现在是早上5点,我很生气。我对BDB一点也不感兴趣,我只是想用它做个实验。macports更全面,我只是提到fink,所以我不喜欢它。
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