简体   繁体   English

Snow Leopard上的PyODBC-安装错误

[英]PyODBC on Snow Leopard - Install Error

Has anyone succesffuly installed PyODBC on snow leopard? 有人成功在雪豹上安装了PyODBC吗?

I'm getting the error below. 我收到以下错误。 (I also submitted a bug here too) Any ideas how to fix this and get it installed? (我也在这里也提交了一个错误 )关于如何解决并安装它的任何想法?

Here is the output I'm getting: 这是我得到的输出:

$ python setup.py install
running install
running bdist_egg
running egg_info
writing pyodbc.egg-info/PKG-INFO
writing top-level names to pyodbc.egg-info/top_level.txt
writing dependency_links to pyodbc.egg-info/dependency_links.txt
reading manifest file 'pyodbc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyodbc.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-universal/egg
running install_lib
running build_ext
building 'pyodbc' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DPYODBC_VERSION=2.1.8 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c /Users/pinerog/Downloads/pyodbc-2.1.8/src/buffer.cpp -o build/temp.macosx-10.6-universal-2.6/Users/pinerog/Downloads/pyodbc-2.1.8/src/buffer.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/datetime.h:186: warning: ‘PyDateTimeAPI’ defined but not used
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/datetime.h:186: warning: ‘PyDateTimeAPI’ defined but not used
/Users/pinerog/Downloads/pyodbc-2.1.8/src/buffer.cpp:58: fatal error: error writing to -: Broken pipe
compilation terminated.
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/datetime.h:186: warning: ‘PyDateTimeAPI’ defined but not used
lipo: can't open input file: /var/folders/z3/z3Y30fNyGvennzCS3hWhkLlN-Ec/-Tmp-//ccZURNsn.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1

Versions: PyODBC 2.1.8, Mac 10.6.7, and Python 2.6.1 版本:PyODBC 2.1.8,Mac 10.6.7和Python 2.6.1

Your problem is likely the combination of xcode 4 and setuptools. 您的问题可能是xcode 4和setuptools的组合。 See this error: 看到此错误:

/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/datetime.h:186: warning: ‘PyDateTimeAPI’ defined but not used
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

setuptools tries to compile for ppc but xcode 4 no longer supports it. setuptools尝试为ppc进行编译,但xcode 4不再支持它。

Try compiling like this: 尝试像这样编译:

ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install

I use macports to install pyodbc 我使用macports安装Pyodbc

sudo port install py26-odbc 须藤端口安装py26-odbc

py26-odbc is for python 2.6. py26-odbc适用于python 2.6。 If you use Python 2.7, the name would be py27-odbc 如果使用Python 2.7,则名称为py27-odbc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM