引き続き、「入門ソーシャルデータ」に沿ってデータマイニングに取り組みます。
ソーシャルデータの可視化のために、Graphvizとpygraphvizをインストールします。
Graphviz :DOTという言語出力ファイルを基に、グラフを生成するツールとして有名です。
pygraphviz:pythonを用いて、DOTファイルを生成します。
Mac OSX Lion用のインストールパッケージをダウンロードします。
http://www.graphviz.org/Download_macos.php
パッケージ名:graphviz-2.28.0.pkg
graphviz-2.28.0.pkgをダブルクリックするとインストーラが起動します。
続けるをクリックしていき、インストールを完了します。
次にpygraphvizのインストールです。
例のごとく、easy_installを使用しますが、そのまま実行するとエラーが出ました。
# easy_install pygraphviz
Searching for pygraphviz
Reading http://pypi.python.org/simple/pygraphviz/
Reading http://networkx.lanl.gov/pygraphviz
Reading http://networkx.lanl.gov/download/pygraphviz
Reading http://networkx.lanl.gov/wiki/download
Reading http://networkx.lanl.gov/download
Reading http://sourceforge.net/project/showfiles.php?group_id=122233&package_id=161979
Best match: pygraphviz 1.1
Downloading http://networkx.lanl.gov/download/pygraphviz/pygraphviz-1.1.tar.gz
Processing pygraphviz-1.1.tar.gz
Running pygraphviz-1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xlJIBD/pygraphviz-1.1/egg-dist-tmp-qS3unp
Trying pkg-config
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
Trying dotneato-config
Failed to find dotneato-config
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_path and library_path variables in setup.py to
point to the correct locations of your graphviz installation.
The current setting of library_path and include_path is:
library_path=None
include_path=None
error: None
パスが通ってないようですが、対処がわかりません。
pipを使用するのはどうかと。
# pip install pygraphviz
Downloading/unpacking pygraphviz
Downloading pygraphviz-1.1.tar.gz (90Kb): 90Kb downloaded
Running setup.py egg_info for package pygraphviz
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
Trying pkg-config
Trying dotneato-config
Failed to find dotneato-config
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_path and library_path variables in setup.py to
point to the correct locations of your graphviz installation.
The current setting of library_path and include_path is:
library_path=None
include_path=None
Traceback (most recent call last):
File "", line 14, in
File "/private/var/root/build/pygraphviz/setup.py", line 89, in
raise OSError,"Error locating graphviz."
OSError: Error locating graphviz.
Complete output from command python setup.py egg_info:
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
Trying pkg-config
Trying dotneato-config
Failed to find dotneato-config
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_path and library_path variables in setup.py to
point to the correct locations of your graphviz installation.
The current setting of library_path and include_path is:
library_path=None
include_path=None
Traceback (most recent call last):
File "", line 14, in
File "/private/var/root/build/pygraphviz/setup.py", line 89, in
raise OSError,"Error locating graphviz."
OSError: Error locating graphviz.
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /var/root/.pip/pip.log
include_path、library_path variablesについて、graphvizをインストールした場所にパスを通す必要があるようです。
指示通りsetup.pyを編集します。
# OSX, Linux, alternate location
library_path='/usr/local/lib/graphviz'
include_path='/usr/local/include/graphviz'
再度、インストール実行で無事インストールできました。