Given that I've spent a few hours to get it right, here is how I did it.
First install the required dependencies using Homebrew, by this I mean at least
brew install python libevent
Then upgrade setuptools with
curl https://bootstrap.pypa.io/ez_setup.py -o - | python
this will prevent the egg_info
error while installing gevent.
Finally, install the two packages
pip install gevent gunicorn
ignoring the
yield from self.wsgi.close()
^
SyntaxError: invalid syntax
error (due to some known issues with a Python 3 dependency not supported by Python 2).
Once done, a very minimal test that it is correctly installed is
echo -e 'def app():\n\tpass' > app.py
gunicorn --log-level INFO --error-logfile - -k gevent app:app
that should output something like
[2014-11-18 11:00:52 +0100] [49167] [INFO] Starting gunicorn 19.1.1
[2014-11-18 11:00:52 +0100] [49167] [INFO] Listening at: http://127.0.0.1:8000 (49167)
[2014-11-18 11:00:52 +0100] [49167] [INFO] Using worker: gevent
[2014-11-18 11:00:52 +0100] [49170] [INFO] Booting worker with pid: 49170
the relevant part being that Using worker: gevent
message.