python gevent导入错误
当我运行一个gevent示例时,我在这里得到import error。 我使用的是macos,gevent是由pip安装的python gevent导入错误,python,gevent,Python,Gevent,当我运行一个gevent示例时,我在这里得到import error。 我使用的是macos,gevent是由pip安装的 Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more informa
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gevent
>>> from gevent import socket
>>> urls = ['www.google.com', 'www.example.com', 'www.python.org']
>>> jobs = [gevent.spawn(socket.gethostbyname, url) for url in urls]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gevent/greenlet.py", line 201, in spawn
g = cls(*args, **kwargs)
File "gevent/greenlet.py", line 75, in __init__
hub = get_hub()
File "gevent/hub.py", line 169, in get_hub
hub = _threadlocal.hub = hubtype(*args, **kwargs)
File "gevent/hub.py", line 268, in __init__
loop_class = _import(self.loop_class)
File "gevent/hub.py", line 198, in _import
return _import(path[-1])
File "gevent/hub.py", line 210, in _import
x = __import__(module)
ImportError: No module named core
在使用以下方法后,现在它运行良好
tanminghuan@bogon ~/Code $ export CFLAGS=-I/opt/local/include
tanminghuan@bogon ~/Code $ sudo pip install cython "git+git://github.com/surfly/gevent.git@1.0rc3#egg=gevent"
ystem/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c-ares/inet_ntop.c -o build/temp.maco
你想在x64机器上安装x86软件包吗?@Serdalis构建是由pip完成的,我不知道pip为什么选择i386。还有一件事,在gevent的python库中,有core.so,我找不到core.py。我唯一能想到的是重新安装依赖项,或者尝试gevent的1.0候选版本。
tanminghuan@bogon ~/Code $ export CFLAGS=-I/opt/local/include
tanminghuan@bogon ~/Code $ sudo pip install cython "git+git://github.com/surfly/gevent.git@1.0rc3#egg=gevent"
ystem/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c-ares/inet_ntop.c -o build/temp.maco