[PYTHON] `pip install pygraphviz` fails to find graphviz

When installing pygraphviz (1.3.1), I got an error that library_dirs and ʻinclude_dirs` were not found.

environment

Solution

I didn't install graphviz, so I installed it.

sudo aptitude install graphviz graphviz-dev

-> I also added dev, but this alone didn't solve the problem.

I found the library path can be found by uncommenting setup.py Error in installing pygraphviz --Miscellaneous notes.

So, read setup.py and sudo aptitude install pkg-config It worked. It's annoying to mess with setup.py even though I installed it with pip.

Reference: Error message

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

Recommended Posts

`pip install pygraphviz` fails to find graphviz
How to install pip
When pip install fails
Note: What to do if pip install fails
What to do if pip install fails in Xcode 5.1
What to do if pip install fails to install dependent libraries
What to do if `pip install matplotlib` fails on Mac
What to do if pip install mysqlclient fails on MacOS
Pip install --ugrade pip fails on Windows
How to install and use Graphviz
How to install mysql-connector with pip3
I was addicted to pip install mysqlclient
I want to pip install with PythonAnywhere
Install python on xserver to use pip
sudo pip install
How to install pip, numpy in Autodesk MAYA
[Personal memo] pip install fails, so solve it
How to install / verify graphviz on anaconda / windows10
Steps to install your own library with pip
What to do if you can't pip install mysqlclient
Install pip on Mavericks
Install pip, pyenv, BeautifulSoup4
How to install Python
How to install archlinux
How to install python
Error with pip install
How to install BayesOpt
Install the pip command
Install pygraphviz on Windows 10
How to install Nbextensions
How to install Prover9
Install pip / pip3 on Ubuntu
Install scikit.learn with pip
[Road to intermediate Python] Install packages in bulk with pip
Can't find the package you installed with pip install --user?
Steps to install a Git cloned package locally with pip