在 OSX 上构建 Cython 和 gevent
当我构建 gevent 时,出现错误
Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.1/bin/cython", line 7, in from Cython.Compiler.Main import main File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Main.py", line 19, in import Code ImportError: dlopen(/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Code.so, 2): no suitable image found. Did find: /usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Code.so: mach-o, but wrong architecture
我尝试使用 CFLAGS="-arch x86_64" 指定体系结构,但它不起作用。
When I build gevent, I get an error
Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.1/bin/cython", line 7, in from Cython.Compiler.Main import main File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Main.py", line 19, in import Code ImportError: dlopen(/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Code.so, 2): no suitable image found. Did find: /usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/Cython-0.14.1-py2.7-macosx-10.4-i386.egg/Cython/Compiler/Code.so: mach-o, but wrong architecture
I tried to specify architecture with CFLAGS="-arch x86_64", but it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重新编译 gevent-1.0dev 和 greenlet 并带有标志 CFLAGS="-arch i386 -arch x86_64" 是我的问题的解决方案。
Recompilation gevent-1.0dev and greenlet with flags CFLAGS="-arch i386 -arch x86_64" is a solution to my problem.
gevent 版本包含生成的 .c 源,因此您不需要 Cython 来构建它们。
开发版本 (1.0) 还自动生成了包含以下 .c 文件的 tarball:http:// /code.google.com/p/gevent/downloads/list
The gevent releases include the generated .c sources so you don't need Cython to build them.
The development version (1.0) also has automatically generated tarballs that includes those .c files: http://code.google.com/p/gevent/downloads/list