15 Nov 2011, 11:53

compile gevent on OSX or FreeBSD with pip

Share

It’s more a reminder to myself, gevent depends on libevent2 but the setup.py doesn’t correcty look for it, a simple solution:

export CFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
pip install gevent

change it for /opt/local/… if you are on OSX or you will get a bunch of errors

   /Developer/usr/bin/llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/core.c -o build/temp.macosx-10.7-x86_64-2.7/gevent/core.o
    In file included from gevent/core.c:225:
    gevent/libevent.h:9:19: error: event.h: No such file or directory
    gevent/libevent.h:38:20: error: evhttp.h: No such file or directory
    gevent/libevent.h:39:19: error: evdns.h: No such file or directory

By the way here is the ultimate stacks for python web dev ;)

pip install flask 
pip install requests
export CFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
pip install gevent
pip instal ujson
pip install validictory