python - 雪豹上的 PyODBC - 安装错误

标签 python macos gcc osx-snow-leopard pyodbc

有人在雪豹上成功安装PyODBC吗?

我收到以下错误。 (我也提交了 bug here)有什么想法如何解决这个问题并安装它吗?

这是我得到的输出:

$ 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

版本:PyODBC 2.1.8、Mac 10.6.7 和 Python 2.6.1

最佳答案

您的问题可能是 xcode 4 和 setuptools 的组合。看到这个错误:

/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 尝试为 ppc 进行编译,但 xcode 4 不再支持它。

尝试这样编译:

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

关于python - 雪豹上的 PyODBC - 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5582567/

相关文章:

python - 可选参数 "constants"在 keras 循环层中做什么?

objective-c - Objective-C - 如何访问 OS X 服务 "Summarize"

xcode - Firemonkey App 无法上传到 Mac App Store

c++ - undefined symbol : vtable

python - 创建Docker镜像后; docker 运行给出ModuleNotFoundError

python - 如何删除与 pandas 的某个值相对应的最大行以外的所有行?

objective-c - 如果盖子关闭,如何以编程方式从 sleep 中醒来?

c++ - gcc 会自动使用-j4 吗?我可以做些什么来优化我的编译吗?

使用 header 错误 header 交叉编译应用程序和 gcc

python - 使用 bs4 和请求处理后如何正确打印出 unicode 文本?