LoginSignup
5
1

More than 5 years have passed since last update.

`pip install pygraphviz`がgraphvizの発見に失敗する

Posted at

pygraphviz (1.3.1) をインストールするときに、library_dirsinclude_dirsが見つからないというエラーが出た。

環境

  • Debian jessie (on VirtualBox)
  • Python 3.5.1

解決法

graphvizを入れていなかったのでインストールした。

sudo aptitude install graphviz graphviz-dev

-> ついでにdevも入れてみたけどこれだけじゃ解決しなかった。

setup.pyのコメントを外したらライブラリパスをみつけられるよっていうものpygraphvizのインストールでエラー - 雑記を発見。

で、setup.pyを読んで、
sudo aptitude install pkg-config
をしたらうまくいった。
せっかくpipでインストールしてるのにsetup.pyをいじるのめんどくさいからね。

参考:エラーメッセージ

vagrant@debian-jessie:~/$ pip install pygraphviz
Collecting pygraphviz
  Using cached pygraphviz-1.3.1.tar.gz
Installing collected packages: pygraphviz
  Running setup.py install for pygraphviz ... error
    Complete output from command /home/vagrant/.pyenv/versions/3.5.1/envs/sitegraph/bin/python3.5 -u -c "
import setuptools, tokenize;__file__='/tmp/pip-build-g95csk3x/pygraphviz/setup.py';exec(compile(getattr(t
okenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/
pip-5vp5ruci-record/install-record.txt --single-version-externally-managed --compile --install-headers /h
ome/vagrant/.pyenv/versions/3.5.1/envs/sitegraph/include/site/python3.5/pygraphviz:
    running install
    Trying pkg-config
    Failed to find pkg-config
    Trying dotneato-config
    Failed to find 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_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.

    ----------------------------------------
Command "/home/vagrant/.pyenv/versions/3.5.1/envs/sitegraph/bin/python3.5 -u -c "import setuptools, toke$
ize;__file__='/tmp/pip-build-g95csk3x/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)($
_file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5vp5ruci-record/inst
all-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.pyenv/versi
ons/3.5.1/envs/sitegraph/include/site/python3.5/pygraphviz" failed with error code 1 in /tmp/pip-build-g9
5csk3x/pygraphviz
5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1