Mac OS X (Yosemite) の
setup.py
を
エラーの 内容
pip install 実行
pip install pygraphviz
エラー内容
Your Graphviz installation could not be found. 1) You don't have Graphviz installed: Install Graphviz (http://graphviz.org) 2) Your Graphviz package might incomplete. Install the binary development subpackage (e.g. libgraphviz-dev or similar.) 3) You are using Windows There are no PyGraphviz binary packages for Windows but you might be able to build it from this source. See http://networkx.lanl.gov/pygraphviz/reference/faq.html If you think your installation is correct you will need to manually change the include_dirs and library_dirs variables in setup.py to point to the correct locations of your graphviz installation. The current setting of library_dirs and include_dirs is: library_dirs=None include_dirs=None error: Error locating graphviz.
Your Graphviz installation could not be found.
ですので、Graphviz が 見つからないと 言われています。
find でgraphviz を 探すと 以下のような 結果と なりました。
graphviz は存在しましたので virtualenv 環境だと path が 通っていないようです。 find コマンドの
結果 % sudo find / -name graphviz ...... /usr/local/Cellar/graphviz /usr/local/Cellar/graphviz/2.38.0/include/graphviz /usr/local/Cellar/graphviz/2.38.0/lib/graphviz /usr/local/Cellar/graphviz/2.38.0/share/graphviz /usr/local/include/graphviz /usr/local/lib/graphviz /usr/local/opt/graphviz /usr/local/share/graphviz /usr/local/var/homebrew/linked/graphviz /usr/share/file/magic/graphviz
参考
手順
前提
graphvizを
brew install graphviz
1. pygraphvizの ソースコードを 取得
PyGraphvizの
※現在の
2. pygraphvizの ダウンロードディレクトリに ある、 setup_extra.pyを 編集する
setup_extra.py内に
def _pkg_config(): # attempt to find graphviz installation with pkg-config # should work with modern versions of graphviz library_dirs=None include_dirs=None
def _pkg_config(): # attempt to find graphviz installation with pkg-config # should work with modern versions of graphviz library_path='/usr/local/lib/graphviz/' include_path='/usr/local/include/graphviz/'
環境に
3. Terminalで virtualenvの 仮想環境に 入る
4. pygraphvizの ダウンロードディレクトリに 移動して、 以下の コマンドを 実行
python setup.py install
上記以外の 方法は あるのか ?
install - Python does not see pygraphviz - Stack Overflow を
ただ、
pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
以上です。
コメント