-
Notifications
You must be signed in to change notification settings - Fork 210
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
Installation:fatal error: 'graphviz/cgraph.h' file not found #11
Comments
Do you have the graphviz development files installed? On Ubuntu, for example, they are in a package called libgraphviz-dev. I don't know how one would install them on a Mac. |
I use |
Can you remove the dirs you wrote and post the error message? EDIT: the dirs that you added should have the graphviz files (not pygraphviz). It seems that the problem is that you need to install graphviz, which isn't a python package, so I don't see how you would install it with pip. Download link for MacOS graphviz: http://www.graphviz.org/Download_macos.php |
OK ,I finish the job,thanks a lot! |
How did you solve this problem? I have the same situation with you but I use windows 7 |
I use Windoews 7 OS |
Hi, pygraphviz/graphviz_wrap.c:2954:10: fatal error: 'graphviz/cgraph.h' file not found
Command "/usr/bin/python -c "import setuptools, tokenize;file='/private/var/folders/sj/yk1843h92lsgdxvzbvjxhk_80000gn/T/pip-build-KIO55c/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/sj/yk1843h92lsgdxvzbvjxhk_80000gn/T/pip-SwBY6j-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/sj/yk1843h92lsgdxvzbvjxhk_80000gn/T/pip-build-KIO55c/pygraphviz Can you please elaborate on how to resolve the issue? |
Having the same problem as @AgalyaLoganathan on OS X 10.11 El Capitan EDIT: I managed to fix it by doing two things:
|
My problem was:
Fixed with: /usr/local/Cellar/graphviz/2.38.0/include/graphviz> ln -s . graphviz
|
Can be solved with
Or with: (credits to http://www.alexandrejoseph.com/blog/2016-02-10-install-pygraphviz-mac-osx.html)
|
Windows 7
...
|
The original post was about mac os. But with your windows install attempt either you are missing the graphviz package (or parts of it) or else the pygraphviz setup code is not finding your graphviz installation and you may need to explicitly set that. |
Thanks a lot. Yes: http://graphviz.org/Download_windows.php Then I could solve riddles, one after the other ...
but now I get "49 unresolved externals"
|
On Mac OS 10.11.3, using macport, solved this issue with : pip install --install-option="--include-path=/opt/local/include" --install-option="--library-path=/opt/local/lib" pygraphviz |
@steven7777 |
I'm on Mac OS 10.11.6. When I try setting up pygraphviz through pip it tells me it can't find graphviz. When I specify the library and include path it doesn't recognize the options. I have opened an issue here: #100. How did you solve this problem? |
Tks @Steven777 pip install --install-option="--include-path=/opt/local/include" --install-option="--library-path=/opt/local/lib" pygraphviz |
this worked for me: I have Mac OS X 10.6 (Snow Leopard) and the problem was that the default include path was set to
which is stupid because the default include path is not consistent, it needed to remove the last Fixed via
|
|
I had a problem due to El Capitan https://arstechnica.com/gadgets/2015/09/os-x-10-11-el-capitan-the-ars-technica-review/8/#h1 solved it by adding --user to pip pip install --user --install-option="--include-path=/opt/local/include" --install-option="--library-path=/opt/local/lib" pygraphviz |
This worked for me on Mojave. Step 1. Step 2. |
I followed below steps
It worked for me |
Catalina (10.15.2) brew install graphviz
pip install --install-option="--include-path=/usr/local/Cellar/graphviz/2.42.2/include/" --install-option="--library-path=/usr/local/Cellar/graphviz/2.42.2/lib/" pygraphviz |
worked for me too! thanks |
Only thing that worked for me is @bwagner 's final comment after trying dozens of different options. Please add to the install docs for macOS Sonoma.
|
Note that this is what is currently recommended in the installation guide - if there are any additional tweaks required please raise an issue about it! |
Following the installation guide fails for me. I posted an issue on pypa/pip before finding this issue: pypa/pip#12531 |
I did this to make it work:
This worked for me. |
Adding these environment variables globally and permanently to your environment is like wearing ski gear everywhere you go just because you occasionally go skiing. |
That may be but I found setting them globally advantageous if you have multiple projects that use pythongraphviz, if you have to occasionally rebuild your poetry environment from scratch because PyCharm screwed it up, if brew chokes and needs a reinstall every now and then, and if you just try to keep you dev environment up to date without constantly breaking things. YMMV but I found myself too often looking up how to fix this compile error, and being presented with different search results as time passes but the compile error remains. But yes, if you have the patience to live with the variables passed to a single call, it's certainly less intrusive. |
Still works for me! Thaanks! |
Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com>
* Updates for modern macOS dev Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com>
* Updates for modern macOS dev Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit 1de6ff9) # Conflicts: # source/Installation/Alternatives/macOS-Development-Setup.rst
* Updates for modern macOS dev Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit 1de6ff9) # Conflicts: # source/Installation/Alternatives/macOS-Development-Setup.rst
* Updates for modern macOS dev (#4242) * Updates for modern macOS dev Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit 1de6ff9)
* Updates for modern macOS dev (#4242) * Updates for modern macOS dev Latest version of pip is needed, as well as a few config flags to show where to find graphviz (pygraphviz/pygraphviz#11 is somehow still helpful / relevant this many years on...) Signed-off-by: Corey Quinn <QuinnyPig@users.noreply.github.com> Co-authored-by: Chris Lalancette <clalancette@gmail.com> (cherry picked from commit 1de6ff9)
All of the above looks like workarounds. Does anyone know where this would actually be fixed? If here, why is it closed (I'm happy to open a new issue if helpful). If |
@bwagner pointed out that the solution below may not work for everyone and already gave a solution that tackles it better. So try the #11 (comment) --
|
^ This worked for me on m1 mac too, thanks a lot! |
Why provide a brittle solution when there's already a functional one? Did you try the previous solution? Here's why providing In addition, following your instructions causes warnings:
|
Dear @bwagner, |
life saver |
Thanks to the @ozturkcemal's answer this worked for me: |
Using mise to maintain different Python versions, @sitatec's approach didn't cut it for me, but my previous solution did. (cloning the repo ceased being necessary for a while now). Repeated here: pip install \
--config-settings="--global-option=build_ext" \
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
pygraphviz Python: 3.12.4 |
This worked for me with
Python: 3.12.7 |
I use mac os
I run the code:
But it didn't success
So I write the dirs:
But it cause the error
Could you help to solve it?Thanks a lot
The text was updated successfully, but these errors were encountered: