奇怪的pip bug。无法安装某些模块,但我可以安装其他模块

时间:2014-12-01 02:44:14

标签: python pip grequests

尽管我有最好的表现,但我似乎无法让gevent或grequests工作。他们都依赖于greenlet,我也无法工作。

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

计算机:

  • Mac OSX优胜美地版本10.10.1
  • MacBook Pro(Retina,15英寸,2013年末)
  • 2.3 GHz Intel Core i7
  • 16 GB 1600 MHz DDR3
  • Intel Iris Pro 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:

我必须在某些时候破坏某些东西,因为现在我安装的所有模块都没有通过。我过去安装的模块仍可正常工作,但新模块的错误与上述相同。

1 个答案:

答案 0 :(得分:2)

重新安装后,我仍然遇到了问题。我认为/Library/Frameworks/Python.framework/Versions/2.7/bin/python是系统安装版本,但事实并非如此。

我需要将其删除并将其从~/.bash_profile删除,然后一切正常。我不知道这是否是我唯一的问题,因为重新安装可以修复一些东西,但我认为是。