Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for issues installing pygraphviz #227

Open
cthoyt opened this issue Jul 20, 2023 · 1 comment
Open

Add documentation for issues installing pygraphviz #227

cthoyt opened this issue Jul 20, 2023 · 1 comment

Comments

@cthoyt
Copy link
Member

cthoyt commented Jul 20, 2023

This isn't a MIRA-specific issue, but I've been getting the following error since there's no pre-built wheel for pygraphviz for my system configuration (py310, mac os 13)

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -DSWIG_PYTHON_STRICT_BYTE_CHAR -I/Users/cthoyt/.virtualenvs/indra/include -I/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-13-x86_64-cpython-310/pygraphviz/graphviz_wrap.o
      pygraphviz/graphviz_wrap.c:3020:10: fatal error: 'graphviz/cgraph.h' file not found
      #include "graphviz/cgraph.h"
               ^~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

I figured out based on the homebrew troubleshooting in the docs (https://pygraphviz.github.io/documentation/stable/install.html#homebrew) that the following works:

pip install --use-pep517 \
            --config-setting="--global-option=build_ext" \
            --config-setting="--build-option=-I$(brew --prefix graphviz)/include/" \
            --config-setting="--build-option=-L$(brew --prefix graphviz)/lib/" \
            pygraphviz

we should add this to our installation docs for anyone else who might stumble on this. I'm looking into this to see if this will work with tox

@liunelson
Copy link

I recently encountered an adjacent issue. I recently tried to install graphviz on my machine (CentOS Stream 9) and I wasn't able to do it, i.e. sudo dnf install graphviz graphviz-devel returned an error that says it cannot find graphviz-devel.

I found the solution after stitching together various forum comments together. The problem was that I was missing the CRB package repository (https://pkgs.org/search/?q=graphviz-devel).

# list all repos
dnf repolist all

# enable it
sudo dnf config-manager --set-enabled crb

# check availability
dnf list available graphviz*

# install
sudo dnf install graphviz graphviz-devel
pip install pygraphviz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants