在 OSX 上构建 Cython 和 gevent

发布于 2024-11-14 10:37:50 字数 742 浏览 3 评论 0原文

当我构建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北风几吹夏 2024-11-21 10:37:50

重新编译 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.

拥抱我好吗 2024-11-21 10:37:50

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文