How can I install the Python library ‘gevent’ on Mac OS X Lion

Don’t post the entire thing! That’s too much! 90% of the time, the first error is enough…

gevent/libevent.h:9:19: error: event.h: No such file or directory

This means that the library which provides the event.h header is not installed. The library is called libevent (website).

In general, compilation errors like these are a flaw in the build scripts. The build script should give an error message that libevent is not installed, and it is a bug that it did not do so.

To get libevent from MacPorts and then manually tell compiler with CFLAGS environment variable where to find event.h and libevent while running pip.

sudo port install libevent
CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent

You can also use homebrew for installing libevent : brew install libevent
(from David Wolever’s comment)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)