Skip to content

Instantly share code, notes, and snippets.

@garsue
Created May 14, 2012 21:17
Show Gist options
  • Save garsue/2697162 to your computer and use it in GitHub Desktop.
Save garsue/2697162 to your computer and use it in GitHub Desktop.
Mac OS Xでのgeventインストール

Mac OS Xでのgeventインストール

前提

homebrewを使ってlibeventを入れたものとする。 そうでない場合は以下libeventのパスを適宜読み替える。

インストール方法

pipを使って入れる。オプションでlibevent関連のライブラリパスを明示的に指定する。:

pip install --install-option="-I/usr/local/include" --install-option="-L/usr/local/lib" gevent

パスは必ず絶対パスで渡す。

詳細

pipは--install-optionsetup.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が一般的なパスにインストールされていない場合は上記オプションで指定できる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment