0

Despite my best effors, I can't seem to get gevent or grequests working. They both rely on greenlet which I can't get working either.

I've completely installed and reinstalled python via homebrew. I haven't tried using python's installer but I don't see why that would matter. I have upgraded xcode to the latest version and installed literally every plugin. I regularly have success installing python modules via pip. I've been trying to install grequests for the last month.

Computer:

  • Mac OSX Yosemite Version 10.10.1
  • MacBook Pro (Retina, 15-inch, Late 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

Edit:

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

Edit 2:

I must have broken something at some point because now none of the modules I install are coming through. The modules I've installed in the past still work but the new ones are getting the same errors as above.

Josh Horowitz
  • 655
  • 2
  • 6
  • 15
  • Can you add the output of `which -a python` to your question? – cel Dec 01 '14 at 12:24
  • 1
    looks like the interpreters in your path are not in the right order. Does `/usr/local/bin/python -c 'import grequests'` print an error message? – cel Dec 01 '14 at 20:15
  • It seems that pip install has stopped working all together. This is very frustrating. I may end up reinstalling the OS. – Josh Horowitz Dec 02 '14 at 00:24
  • Reinstalling your OS is probably not necessary. Yet removing all python distributions and `site-packages` directories except OSX native python version and reinstalling afterwards might solve this problem. I can recommend switching to the `anaconda` or `miniconda` scientific python distributions. It may take some time to get used to the concept of virtualenvs, but believe me, it will make life easier in the long term. – cel Dec 02 '14 at 07:46

1 Answers1

2

After reinstalling everything, I still had the problem. I thought that /Library/Frameworks/Python.framework/Versions/2.7/bin/python was the system installed version, but it's not.

I needed to delete that and remove it from ~/.bash_profile that and then everything worked fine. I don't know if that was my only problem as the reinstall could have fixed something, but I think it was.

Josh Horowitz
  • 655
  • 2
  • 6
  • 15