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

Installation:fatal error: 'graphviz/cgraph.h' file not found #40

Closed
whu-zhigao opened this issue Nov 26, 2014 · 23 comments
Closed

Installation:fatal error: 'graphviz/cgraph.h' file not found #40

whu-zhigao opened this issue Nov 26, 2014 · 23 comments

Comments

@whu-zhigao
Copy link

I use Windoews 7 OS
and python 3.4.2
I run the code:
python setup.py install

But it cause the error:
D:\pygraphviz-master>python setup.py install
library_dirs=None
include_dirs=None
running install
running bdist_egg
running egg_info
writing top-level names to pygraphviz.egg-info\top_level.txt
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
writing pygraphviz.egg-info\PKG-INFO
reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '~' found anywhere in distributi
on
warning: no previously-included files matching '
.pyc' found anywhere in distrib
ution
warning: no previously-included files matching '.svn' found anywhere in distribu
tion
no previously-included directories found matching 'doc\build'
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
D:\mingw-get\bin\gcc.exe -mdll -O -Wall -DGVDLL -ID:\Python34\include -ID:\Pytho
n34\include -c pygraphviz/graphviz_wrap.c -o build\temp.win32-3.4\Release\pygrap
hviz\graphviz_wrap.o
pygraphviz/graphviz_wrap.c:2954:29: fatal error: graphviz/cgraph.h: No such file
or directory
#include "graphviz/cgraph.h"
^
compilation terminated.
error: command 'D:\mingw-get\bin\gcc.exe' failed with exit status 1

@BartGo
Copy link

BartGo commented Jan 30, 2015

The same for Windows 7 (x64), Python 2.7.8 / Pip 1.2.1 and MS Visual C++ Compiler for Python.

Installation both with "pip install pygraphvis" and with "pip install git://github.com/pygraphviz/pygraphviz.git#egg=pygraphviz" fails, pointing to the same missing graphviz/cgraph.h.

[...]

D:\Users\[me]\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DGVDLL -IC:\Python27\include -IC:\Python27\PC /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-2.7\Release\pygraphviz/graphviz_wrap.obj

graphviz_wrap.c

pygraphviz/graphviz_wrap.c(2954) : fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory

error: command 'D:\\Users\\[me]\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

Command C:\Python27\python.exe -c "import setuptools;__file__='d:\\users\\[me]\\appdata\\local\\temp\\pip-build\\pygraphviz\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record d:\users\[me]\appdata\local\temp\pip-izjhr5-record\install-record.txt --single-version-externally-managed failed with error code 1 in d:\users\[me]\appdata\local\temp\pip-build\pygraphviz
Storing complete log in D:\Users\[me]\pip\pip.log

@xhudik
Copy link

xhudik commented Feb 22, 2015

likely you need to set:
library_dirs='/usr/lib/graphviz'
include_dirs='/usr/include/graphviz'

on 38-39 lines in setup.py. In past, the default paths taken from pkg-config contained doubled .../graphviz

@gjwo
Copy link

gjwo commented May 21, 2015

Same missing header file on Windows 7 under Anaconda
C:\Users\GJWood>conda info
Current conda install:

         platform : win-64
    conda version : 3.11.0-dirty

conda-build version : 1.11.0
python version : 2.7.9.final.0
requests version : 2.7.0
root environment : C:\Users\GJWood\Anaconda (writable)
default environment : C:\Users\GJWood\Anaconda
envs directories : C:\Users\GJWood\Anaconda\envs
package cache : C:\Users\GJWood\Anaconda\pkgs
channel URLs : https://repo.continuum.io/pkgs/free/win-64/
https://repo.continuum.io/pkgs/free/noarch/
https://repo.continuum.io/pkgs/pro/win-64/
https://repo.continuum.io/pkgs/pro/noarch/
config file : None
is foreign system : False

@hagberg
Copy link
Contributor

hagberg commented May 21, 2015

This should be resolved (or fixable by setting paths) with #52

@hagberg hagberg closed this as completed May 21, 2015
@gjwo
Copy link

gjwo commented May 21, 2015

Aric,
the file cgraph.h does not exist on my PC so I am not clear how setting the
path will help?

On 21 May 2015 at 16:10, Aric Hagberg notifications@github.com wrote:

This should be resolved (or fixable by setting paths) with #52
#52


Reply to this email directly or view it on GitHub
#40 (comment)
.

@hagberg
Copy link
Contributor

hagberg commented May 21, 2015

You'll need to get a full install of graphviz with the header sources if
you don't have them.
Then make sure the include path points to the place where cgraph.h is.

On Thu, May 21, 2015 at 9:49 AM, Graham Wood notifications@github.com
wrote:

Aric,
the file cgraph.h does not exist on my PC so I am not clear how setting the
path will help?

On 21 May 2015 at 16:10, Aric Hagberg notifications@github.com wrote:

This should be resolved (or fixable by setting paths) with #52
#52


Reply to this email directly or view it on GitHub
<
https://github.com/pygraphviz/pygraphviz/issues/40#issuecomment-104313751>

.


Reply to this email directly or view it on GitHub
#40 (comment)
.

@gjwo
Copy link

gjwo commented May 21, 2015

I cloned the repository on 21st May 2015 so I don't know where else to look for the file
image

@hagberg
Copy link
Contributor

hagberg commented May 21, 2015

cgraph.h is part of graphviz (see graphviz.org).
Pygraphviz is a Python wrapper of graphviz to make it (hopefully) easier to
use from Python.

On Thu, May 21, 2015 at 10:00 AM, Graham Wood notifications@github.com
wrote:

I cloned the repository on 21st May 2015 so I don't know where else to
look for the file
[image: image]
https://cloud.githubusercontent.com/assets/12109990/7753031/cbe0fc0e-ffda-11e4-829d-23c85813d824.png


Reply to this email directly or view it on GitHub
#40 (comment)
.

@jonsedar
Copy link

jonsedar commented Jun 1, 2015

For the next Mac user with this problem. I have this setup...

Mac OSX 10.10.3 Yosemite
gcc Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Anaconda python 3.4
Graphviz 2.38 installed using homebrew to /usr/local/Cellar/graphviz/2.38.0/

... and also found some pain installing pygraphviz:

pip install pygraphviz==1.3rc2

fatal error: 'graphviz/cgraph.h' file not found


The fix that worked for me for was to:

  1. Clone https://github.com/pygraphviz/pygraphviz locally (commit b5f7bcd)
  2. Add extra lines at the top of def get_graphviz_dirs() inside file setup_extra.py:
    # OSX Homebrew location
    include_dirs='/usr/local/Cellar/graphviz/2.38.0/include'
    library_dirs='/usr/local/Cellar/graphviz/2.38.0/lib'
  3. activate my conda virtualenv source activate myenv
  4. pip install (using the pip in myenv) from local filesystem: pip install git+file:///Users/jon/ExternalRepos/pygraphviz/

This seems to have installed correctly. Hope this helps!

A windows user made a similar note at http://stackoverflow.com/a/30275088/1165112

@gjwo
Copy link

gjwo commented Jun 23, 2015

First point to note is don't rely on Windows Start "Search programs and files" to verify if the include or library files are present - on my system it did not check the program files subdirectories which is where the files were all the time. After a standard windows install of Graphviz the lib files are here

  • "C:\Program Files (x86)\Graphviz2.38\lib\release\lib" and the include files are here
  • "C:\Program Files (x86)\Graphviz2.38\include\graphviz"

so in Pygraphviz edit the setup.py file to add these locations as the directories

# Windows
# Unknown - use command line -I and -L switches to set
library_dirs='C:/Program Files (x86)/Graphviz2.38/lib/release/lib'
include_dirs='C:/Program Files (x86)/Graphviz2.38/include'

or use the switches as suggested in addition to the install line below
installation -
python setup.py install

@mbdevpl
Copy link

mbdevpl commented Jun 17, 2016

Hmm... I'm puzzled. Is this issue closed or open? I've just attempted to install pygraphviz 1.3.1 for Python 3.5.1 on 64bit Windows 7 using pip:

python -m pip install pygraphviz

but it didn't end well...

Collecting pygraphviz
  Using cached pygraphviz-1.3.1.zip
Building wheels for collected packages: pygraphviz
  Running setup.py bdist_wheel for pygraphviz ... error
  Complete output from command C:\Programs\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\[redacted]\\AppData\\Local\\Temp\\pip-build-o65h7cg4\\pygraphviz\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\[redacted]\AppData\Local\Temp\tmprjv519ynpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.5
  creating build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\agraph.py -> build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\release.py -> build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\version.py -> build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\__init__.py -> build\lib.win-amd64-3.5\pygraphviz
  creating build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_attributes.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  copying pygraphviz\tests\__init__.py -> build\lib.win-amd64-3.5\pygraphviz\tests
  running egg_info
  writing dependency_links to pygraphviz.egg-info\dependency_links.txt
  writing top-level names to pygraphviz.egg-info\top_level.txt
  writing pygraphviz.egg-info\PKG-INFO
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files matching '*~' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '.svn' found anywhere in distribution
  no previously-included directories found matching 'doc\build'
  writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
  copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.5\pygraphviz
  copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.5\pygraphviz
  running build_ext
  building 'pygraphviz._graphviz' extension
  creating build\temp.win-amd64-3.5
  creating build\temp.win-amd64-3.5\Release
  creating build\temp.win-amd64-3.5\Release\pygraphviz
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Programs\Python35\include -IC:\Programs\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.5\Release\pygraphviz/graphviz_wrap.obj
  graphviz_wrap.c
  pygraphviz/graphviz_wrap.c(2954): fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2

Is the setup supposed to work now, or the workarounds mentioned above are still necessary?

Does MSVC look for the headers only in directories mentioned in the command? I cannot see any graphviz-related path in compiler command executed by setup.py, so it's as if pygraphviz doesn't attempt to look for it.

I ask because I have Graphviz installed in a custom directory. I'd like to avoid cloning the repo and rolling out my custom build just for this. By any chance, is there some command-line option to add custom include path?

Like this:

python -m pip install pygraphviz --install-option="set some compiler flag here"

@mbdevpl
Copy link

mbdevpl commented Jun 17, 2016

I partially figured it out. I can almost install using below command:

python -m pip install pygraphviz --install-option="--include-path=C:\Programs\Graphviz2.38\include" --install-option="--library-path=C:\Programs\Graphviz2.38\lib\release\lib"

These flags resolve the missing graphviz files issues, but the end result is 50 "unresolved external symbol" errors:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Programs\Graphviz2.38\include -IC:\Programs\Python35\include -IC:\Programs\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.5\Release\pygraphviz/graphviz_wrap.obj
    graphviz_wrap.c
    pygraphviz/graphviz_wrap.c(3295): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
    pygraphviz/graphviz_wrap.c(3313): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
    pygraphviz/graphviz_wrap.c(3321): warning C4047: 'return': 'int' differs in levels of indirection from 'Agsym_t *'
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Programs\Graphviz2.38\lib\release\lib /LIBPATH:C:\Programs\Python35\libs /LIBPATH:C:\Programs\Python35\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\um\x64" cgraph.lib cdt.lib /EXPORT:PyInit__graphviz build\temp.win-amd64-3.5\Release\pygraphviz/graphviz_wrap.obj /OUT:build\lib.win-amd64-3.5\pygraphviz\_graphviz.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\pygraphviz\_graphviz.cp35-win_amd64.lib
    graphviz_wrap.obj : warning LNK4197: export 'PyInit__graphviz' specified multiple times; using first specification
       Creating library build\temp.win-amd64-3.5\Release\pygraphviz\_graphviz.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\pygraphviz\_graphviz.cp35-win_amd64.exp
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agwrite
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agisdirected
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agopen
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agraphof
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtin
    graphviz_wrap.obj : error LNK2001: unresolved external symbol aglstnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agedge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agsubedge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agisundirected
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agidnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtsubg
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agisstrict
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agattrsym
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agfstin
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agattr
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agstrdup_html
    graphviz_wrap.obj : error LNK2001: unresolved external symbol Agdirected
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnameof
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agfstnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agget
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agdegree
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agfstedge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agdelsubg
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agdelnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtattr
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agread
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agparent
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agxset
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agclose
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agidedge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agroot
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agfstsubg
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agdeledge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnnodes
    graphviz_wrap.obj : error LNK2001: unresolved external symbol Agundirected
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agxget
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agsubnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtedge
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agsubg
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnedges
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agset
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agfstout
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agsafeset
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agprvnode
    graphviz_wrap.obj : error LNK2001: unresolved external symbol Agstrictundirected
    graphviz_wrap.obj : error LNK2001: unresolved external symbol PyIOBase_Type
    graphviz_wrap.obj : error LNK2001: unresolved external symbol agnxtout
    graphviz_wrap.obj : error LNK2001: unresolved external symbol Agstrictdirected
    build\lib.win-amd64-3.5\pygraphviz\_graphviz.cp35-win_amd64.pyd : fatal error LNK1120: 50 unresolved externals
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1120

@mbdevpl
Copy link

mbdevpl commented Jun 17, 2016

Ok... The final issue seems to be with the fact that I'm using 64bit Python, exactly like in another issue: #58 Sorry for a little bit of spamming above. I'll leave those logs here in case anyone else runs into this issue.

@ColinWilder
Copy link

@mbdevpl Did you ever resolve this? I have run into the same error messages (with LNK1120 etc.) you list above.

@mbdevpl
Copy link

mbdevpl commented Oct 17, 2017

@ColinWilder Unfortunately no - in the meantime my Windows dev machine died, and I don't miss it ;) But it seems like there is some more recent progress in #58, you might wanna try one of these approaches.

@ColinWilder
Copy link

@mbdevpl Are you referring to the comment there about new work by the graphviz people? Saw that. Hope it materializes. Thanks!

@mbdevpl
Copy link

mbdevpl commented Oct 17, 2017

@ColinWilder Unless I completely misunderstood what's written there, it has materialized already... Unless you're waiting for official binary release? In such case, please note that you might wait forever, because on http://www.graphviz.org/ it says that:

Due to organizational changes, the Graphviz web site will see some modifications in the near future. In particular, it will probably no longer provide binary packages for Windows and Macs. The latter can be obtained via Macports or Home Brew. If someone wants to set up Appveyor for Windows, we would be grateful.

@satishdosapati
Copy link

has any one found a solution for this problem...?

@joseortiz3
Copy link

joseortiz3 commented Dec 6, 2017

You guys should mention this package is currently incompatible with Windows and 64-bit Python3 on the front page. Apparently nobody has found a fix despite all these issues being closed. This indicates support for windows is just being dropped.

@snehamaheshwari07
Copy link

@jmwoloso
Copy link

jmwoloso commented Mar 13, 2019

for linux mint users, you need to install libgraphviz-dev not the graphviz package that shows up in synaptic.

Correction: in order to use dot you'll also need to install graphviz to use it from the command line.

@rameshiyerv
Copy link

rameshiyerv commented Jan 15, 2021

I think a lot of people still face some issues with pygraphviz setup on windows... so I wanted to share the exact issue i faced and the fix.
Environment:
Win 10 Enterprise
Python 3.7.9 setup natively (no conda)
graphviz - both python package & windows install package (https://www2.graphviz.org/Packages/stable/windows) installed

Issue I faced:
Similar to many people I kept getting the error "pygraphviz/graphviz_wrap.c(2676): fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory"

Root cause:
Even though the environment variables / PATH are set for grpahviz the setup is unable to find the includes cgraph.h (p.s. this path is for the windows package installed not the python graphviz site-package)

Fix:
in the pip command specify the paths as below:

pip install --global-option=build_ext --global-option="-I(insert the path to your include dir)" --global-option="-L(insert the path to your lib dir)" pygraphviz

example...
pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz2\include" --global-option="-LC:\Program Files\Graphviz2\lib" pygraphviz

@WinterBlue16
Copy link

WinterBlue16 commented Apr 24, 2021

@rameshiyerv Thank you! It works:)

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

No branches or pull requests