我嘗試了最後幾個小時在我的Mac 10.8上安裝grequests。安裝Grequests(卡住gevent)mac OS 10.8
當我pip install
我得到它:
$ 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 install gevent #same with pip-3.2
所以我去了好像我怎麼可以安裝gevent manually。 而我將其視爲先決條件greenlet。
我pip install
,但我得到:
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:
$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
也許我搞砸了與海灣合作委員會的東西..
另外:
$ sudo port install py-greenlet
Error: Port py-greenlet not found
所以,這是我走了多遠。有任何想法嗎?
更新:
我工作圍繞海灣合作委員會的錯誤與簡單編譯tar包python setup.py build install
。雖然我安裝了Cython,但當我嘗試安裝gevent
內置壓縮包時,出現錯誤。
$ 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
我知道它還不穩定,但你有沒有試過gevent 1.0.x的候選版本?所有先決條件都是獨立的。 'pip install cython -e git:// github.com/surfly/gevent.git @ 1.0rc2#egg = gevent' – woozyking
@woozyking是的我也試過這個,現在我記得了。它返回相同的GCC錯誤('失敗,退出狀態1') – Diolor
這可能與OS X是64位/ 32位混合架構怪異有關(我可能完全錯誤,但它與Linux發行版非常不同和Windows,他們用清晰的線條定義64位或32位) – woozyking