homebrewを使ってlibeventを入れたものとする。 そうでない場合は以下libeventのパスを適宜読み替える。
pipを使って入れる。オプションでlibevent関連のライブラリパスを明示的に指定する。:
pip install --install-option="-I/usr/local/include" --install-option="-L/usr/local/lib" gevent
パスは必ず絶対パスで渡す。
pipは--install-optionでsetup.py installに渡すオプションを指定できる。複数指定する場合は--install-optionごと複数渡す。
geventのpython setup.py install -hの冒頭に以下の記述がある。
If you have more than one libevent installed or it is installed in a non-standard location, use the options to point to the right dirs:
-IPATH add include PATH -LPATH add library PATH--libevent PATH use libevent from PATH If configure and make have been run in PATH, this implies -IPATH -IPATH/include -LPATH/.libs Otherwise setup.py will run configure and make and link statically with libevent.
libeventが一般的なパスにインストールされていない場合は上記オプションで指定できる。