0

尽管我尽了最大的努力,但我似乎无法让 gevent 或 grequests 工作。他们都依赖greenlet,我也无法工作。

我已经通过自制软件完全安装并重新安装了 python。我没有尝试过使用 python 的安装程序,但我不明白为什么这很重要。我已将 xcode 升级到最新版本并安装了几乎所有插件。我经常通过 pip 成功安装 python 模块。上个月我一直在尝试安装 grequests。

电脑:

  • Mac OSX 优胜美地版本 10.10.1
  • MacBook Pro(视网膜显示屏,15 英寸,2013 年末)
  • 2.3 GHz 英特尔酷睿 i7
  • 16 GB 1600 MHz DDR3
  • 英特尔虹膜专业版 1536 MB

`

$ sudo pip install greenlet
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages
Cleaning up...

$ sudo pip install gevent
Requirement already satisfied (use --upgrade to upgrade): gevent in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages (from gevent)
Cleaning up...

$ sudo pip install grequests
Requirement already satisfied (use --upgrade to upgrade): grequests in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): gevent in /usr/local/lib/python2.7/site-packages (from grequests)
Requirement already satisfied (use --upgrade to upgrade): requests>=1.0.0 in /Library/Python/2.7/site-packages (from grequests)
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages (from gevent->grequests)
Cleaning up...

'

>>> import grequests
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import grequests
ImportError: No module named grequests

>>> import greenlet    
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import greenlet
ImportError: No module named greenlet

>>> import gevent    
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import gevent
ImportError: No module named gevent

编辑:

$ which -a python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/bin/python
/usr/bin/python

编辑2:

我一定是在某个时候破坏了某些东西,因为现在我安装的所有模块都没有通过。我过去安装的模块仍然可以工作,但新的模块出现与上述相同的错误。

4

1 回答 1

2

重新安装一切后,我仍然遇到问题。我以为/Library/Frameworks/Python.framework/Versions/2.7/bin/python是系统安装版本,但不是。

我需要删除它并从中删除它~/.bash_profile,然后一切正常。我不知道这是否是我唯一的问题,因为重新安装可以解决某些问题,但我认为是。

于 2014-12-02T17:50:31.477 回答