Python 安装Grequests(卡在gevent上)mac OS 10.8

Python 安装Grequests(卡在gevent上)mac OS 10.8,python,gcc,cython,gevent,grequests,Python,Gcc,Cython,Gevent,Grequests,我在最后几个小时尝试在mac 10.8上安装grequests 当我pip安装时it我得到: $ pip install grequests Requirement already satisfied (use --upgrade to upgrade): grequests in /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages Downloading/unpacking gevent (

我在最后几个小时尝试在mac 10.8上安装grequests

当我
pip安装时
it我得到:

$ pip install grequests
Requirement already satisfied (use --upgrade to upgrade): grequests in /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages
Downloading/unpacking gevent (from grequests)
  Running setup.py egg_info for package gevent
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/private/var/folders/hx/_6mzcrld6777n9mfkx7g9dmc0000gp/T/pip-build-ddl449/gevent/setup.py", line 95
        print 'Linking %s to %s' % (path_to_build_core_so, path_to_core_so)
                               ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/private/var/folders/hx/_6mzcrld6777n9mfkx7g9dmc0000gp/T/pip-build-ddl449/gevent/setup.py", line 95

    print 'Linking %s to %s' % (path_to_build_core_so, path_to_core_so)

                           ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /private/var/folders/hx/_6mzcrld6777n9mfkx7g9dmc0000gp/T/pip-build-ddl449/gevent
Storing complete log in /Users/ddl449/.pip/pip.log
所以我开始考虑如何安装gevent。 我认为这是先决条件

pip安装
it,但我得到:

lipo: can't figure out the architecture type of: /var/folders/hx/_6mzcrld6777n9mfkx7g9dmc0000gp/T//ccRlrUpW.out
error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1
然而,我有:

$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
也许我把GCC搞砸了

此外:

所以,我已经走了这么远。有什么想法吗

更新:

我通过简单地编译tarballs
python setup.py build安装来解决GCC错误。虽然我已经安装了Cython,但当我尝试安装
gevent
构建的tarball时,会出现错误

$ sudo python3.3 setup.py install
running install
running bdist_egg
running egg_info
writing requirements to gevent.egg-info/requires.txt
writing dependency_links to gevent.egg-info/dependency_links.txt
writing top-level names to gevent.egg-info/top_level.txt
writing gevent.egg-info/PKG-INFO
reading manifest file 'gevent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile.ext'
writing manifest file 'gevent.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
running build_ext
/usr/local/bin/python3.3 util/cythonpp.py -o gevent.core.c gevent/core.ppyx
Running cython -o gevent.core.c gevent/core.pyx  # !EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)
sh: cython: command not found
Traceback (most recent call last):
  File "util/cythonpp.py", line 801, in <module>
    process_filename(filename, options.output_file)
  File "util/cythonpp.py", line 85, in process_filename
    output = run_cython(pyx_filename, sourcehash, output_filename, banner, comment)
  File "util/cythonpp.py", line 529, in run_cython
    system(command, comment)
  File "util/cythonpp.py", line 539, in system
    raise AssertionError('%r failed with code %s' % (command, result))
AssertionError: 'cython -o gevent.core.c gevent/core.pyx' failed with code 32512
make: *** [gevent/gevent.core.c] Error 1
$sudo python3.3 setup.py安装
正在运行的安装
运行bdist_蛋
运行蛋_信息
将需求写入gevent.egg-info/requires.txt
正在将依赖项链接写入gevent.egg-info/dependency\u links.txt
将顶级名称写入gevent.egg-info/top_level.txt
编写gevent.egg-info/PKG-info
正在读取清单文件“gevent.egg info/SOURCES.txt”
正在读取清单模板“manifest.in”
警告:找不到与“Makefile.ext”匹配的文件
正在编写清单文件“gevent.egg info/SOURCES.txt”
安装库代码以生成/bdist.macosx-10.6-intel/egg
正在运行安装库
运行build\u py
运行build_ext
/usr/local/bin/python3.3 util/cythonpp.py-o gevent.core.c gevent/core.ppyx
正在运行cython-o gevent.core.c gevent/core.pyx#!EV_使用信号FD&!已定义(LIBEV_嵌入)&&!已定义(_WIN32)
sh:cython:未找到命令
回溯(最近一次呼叫最后一次):
文件“util/cythonpp.py”,第801行,在
进程\u文件名(文件名、选项、输出\u文件)
文件“util/cythonpp.py”,第85行,进程中\u文件名
output=run\u cython(pyx\u文件名、sourcehash、output\u文件名、横幅、注释)
文件“util/cythonpp.py”,第529行,在run\u cython中
系统(命令、注释)
文件“util/cythonpp.py”,第539行,在系统中
引发断言错误(“%r失败,代码为%s%”(命令,结果))
断言错误:“cython-o gevent.core.c gevent/core.pyx”失败,代码为32512
make:**[gevent/gevent.core.c]错误1
好的,我就这么做了。 我清除了/usr/local/bin中的GCC。现在它在/usr/bin中。我用过,我不知道这是否有用,但我做到了

我更新到2.7.5(我有2.7.2)和
pip安装cython
。我被安装了。与
gevent
grequest
相同。完成了


然而,
gevent
和可能的
cython
似乎在python 3.3中出现了突破。

我知道它还不稳定,但您尝试过gevent 1.0.x的候选发行版本吗?所有先决条件都是独立的<代码>pip安装cython-egit://github.com/surfly/gevent.git@1.0rc2#egg=gevent
@woozyking是的,我也试过这个,现在我记得了。它返回相同的GCC错误(
失败,退出状态为1
),这可能与OS X是64位/32位混合体系结构的古怪有关(我可能完全错了,但它与Linux发行版和Windows非常不同,在Linux发行版和Windows中,它们定义了64位或32位,并带有清晰的行)@woozyking我一直在解决gcc问题,但现在cython和gevent之间似乎有些麻烦<代码>将库代码安装到build/bdist.macosx-10.6-intel/egg
我想知道这行代码是否正确(10.6?)。
$ sudo port install py-greenlet
Error: Port py-greenlet not found
$ sudo python3.3 setup.py install
running install
running bdist_egg
running egg_info
writing requirements to gevent.egg-info/requires.txt
writing dependency_links to gevent.egg-info/dependency_links.txt
writing top-level names to gevent.egg-info/top_level.txt
writing gevent.egg-info/PKG-INFO
reading manifest file 'gevent.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile.ext'
writing manifest file 'gevent.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
running build_ext
/usr/local/bin/python3.3 util/cythonpp.py -o gevent.core.c gevent/core.ppyx
Running cython -o gevent.core.c gevent/core.pyx  # !EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)
sh: cython: command not found
Traceback (most recent call last):
  File "util/cythonpp.py", line 801, in <module>
    process_filename(filename, options.output_file)
  File "util/cythonpp.py", line 85, in process_filename
    output = run_cython(pyx_filename, sourcehash, output_filename, banner, comment)
  File "util/cythonpp.py", line 529, in run_cython
    system(command, comment)
  File "util/cythonpp.py", line 539, in system
    raise AssertionError('%r failed with code %s' % (command, result))
AssertionError: 'cython -o gevent.core.c gevent/core.pyx' failed with code 32512
make: *** [gevent/gevent.core.c] Error 1