Skip to content

failed building wheel for pygraphviz #163

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

Closed
kawtherOuenniche opened this issue Aug 2, 2018 · 14 comments
Closed

failed building wheel for pygraphviz #163

kawtherOuenniche opened this issue Aug 2, 2018 · 14 comments
Milestone

Comments

@kawtherOuenniche
Copy link

Hello,
I tried installing pygraphviz using the comand pip3 install git+git://github.com/pygraphviz/pygraphviz.git but it raises
`
Collecting git+git://github.com/pygraphviz/pygraphviz.git
Cloning git://github.com/pygraphviz/pygraphviz.git to c:\users\kaouther\appdata\local\temp\pip-req-build-3w79axlv
Building wheels for collected packages: pygraphviz
Running setup.py bdist_wheel for pygraphviz ... error
Complete output from command C:\Users\KAOUTHER\PycharmProjects\chatbot\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\KAOUTHER\AppDa
ta\Local\Temp\pip-req-build-3w79axlv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file
, 'exec'))" bdist_wheel -d C:\Users\KAOUTHER\AppData\Local\Temp\pip-wheel-vg5o6x6n --python-tag cp36:
C:\Users\KAOUTHER\PycharmProjects\chatbot\venv\lib\site-packages\setuptools-39.1.0-py3.6.egg\setuptools\dist.py:388: UserWarning: Normalizing '1.5.dev' to '1.5.dev0'
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\agraph.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\release.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\version.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz_init_.py -> build\lib.win-amd64-3.6\pygraphviz
creating build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_setup.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests_init_.py -> build\lib.win-amd64-3.6\pygraphviz\tests
running egg_info
creating pygraphviz.egg-info
writing pygraphviz.egg-info\PKG-INFO
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
writing top-level names to pygraphviz.egg-info\top_level.txt
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
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.6\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.6\pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\pygraphviz
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\KAOUTHE
R\PycharmProjects\chatbot\venv\include -IC:\Users\KAOUTHER\Anaconda3\include -IC:\Users\KAOUTHER\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\201
7\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\1
0.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Progr
am Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.6\Release\pygraphviz/graphviz_wrap.obj
graphviz_wrap.c
pygraphviz/graphviz_wrap.c(2987): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'graphviz/cgraph.h'ÿ: No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status 2


Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Failed to build pygraphviz
Installing collected packages: pygraphviz
Running setup.py install for pygraphviz ... error
Complete output from command C:\Users\KAOUTHER\PycharmProjects\chatbot\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\KAOUTHER\App
Data\Local\Temp\pip-req-build-3w79axlv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file
, 'exec'))" install --record C:\Users\KAOUTHER\AppData\Local\Temp\pip-record-c0zdl1xf\install-record.txt --single-version-externally-managed --compile --install-heade
rs C:\Users\KAOUTHER\PycharmProjects\chatbot\venv\include\site\python3.6\pygraphviz:
C:\Users\KAOUTHER\PycharmProjects\chatbot\venv\lib\site-packages\setuptools-39.1.0-py3.6.egg\setuptools\dist.py:388: UserWarning: Normalizing '1.5.dev' to '1.5.dev0
'
running install
include_dirs=None
library_dirs=None
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\agraph.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\release.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz\version.py -> build\lib.win-amd64-3.6\pygraphviz
copying pygraphviz_init
.py -> build\lib.win-amd64-3.6\pygraphviz
creating build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_setup.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.6\pygraphviz\tests
copying pygraphviz\tests_init
.py -> build\lib.win-amd64-3.6\pygraphviz\tests
running egg_info
writing pygraphviz.egg-info\PKG-INFO
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
writing top-level names to pygraphviz.egg-info\top_level.txt
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.6\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.6\pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\pygraphviz
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\KAOUT
HER\PycharmProjects\chatbot\venv\include -IC:\Users\KAOUTHER\Anaconda3\include -IC:\Users\KAOUTHER\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2
017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include
\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Pro
gram Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.6\Release\pygraphviz/graphviz_wrap.obj
graphviz_wrap.c
pygraphviz/graphviz_wrap.c(2987): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'graphviz/cgraph.h'ÿ: No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status
2

`
I am using Anaconda python 3 under Windows 10
Any idea?

@jarrodmillman
Copy link
Contributor

The error at the end

pygraphviz/graphviz_wrap.c(2987): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'graphviz/cgraph.h'ÿ: No such file or directory

means that it can't find where you've installed the development files for graphviz (e.g., graphviz/cgraph.h). You may need to install graphviz first. If you have already installed it, then you need to let python know where the header files are.

There is more information in the install file:
https://github.com/pygraphviz/pygraphviz/blob/master/INSTALL.txt

@Aarbor1
Copy link

Aarbor1 commented Sep 11, 2018

I'm also facing same issue but i can't resolve give any way fix the error @jarrodmillman

@nakagawaitcube
Copy link

I could resolve .If any problem teach me@sintaro0221
apt-get install -y graphviz-dev

@nakagawaitcube
Copy link

I added ↑ on my Dockerfile

@morethanbooks
Copy link

The solution by @nakagawaitcube has worked for me. Thanks!

@kushan-gunasekera
Copy link

I could resolve .If any problem teach me@sintaro0221
apt-get install -y graphviz-dev

Thank you so much, it worked!

@Hassanzadeh-sd
Copy link

Hassanzadeh-sd commented Jan 4, 2020

Try this :

sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config

or the following might be needed if you're using Python 3:

sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config

then

sudo pip install pygraphviz

@valon-morinaco
Copy link

valon-morinaco commented Mar 27, 2020

@Hassanzadeh-sd what about for us in windows, I need this library, but could never install it, since I got this error like the user who has made this issue

@LukaszSwolkien
Copy link

@Hassanzadeh-sd what about for us in windows, I need this library, but could never install it, since I got this error like the user who has made this issue

Step 1: Download and install Graphviz

https://graphviz.gitlab.io/_pages/Download/Download_windows.html

Step 2: Add below path to your PATH environment variable

C:\Program Files (x86)\Graphviz2.38\bin

Step 3: Re-open command line and activate venv

venv\Scripts\activate

Step 4: Download binaries for pygraphviz and install in active venv

https://github.com/CristiFati/Prebuilt-Binaries/tree/master/PyGraphviz/v1.5/Graphviz-2.42.2

For example:

In case of python 3.7

pip install pygraphviz-1.5-cp37-cp37m-win_amd64.whl

In case of python 3.8

pip install pygraphviz-1.5-cp38-cp38-win_amd64.whl

Sorry, something went wrong.

@Suryaday
Copy link

Suryaday commented Oct 4, 2020

I could resolve .If any problem teach me@sintaro0221
apt-get install -y graphviz-dev

Thank you so so much!!! I was stuck for an hour on this. This worked so beautifully!!!

Sorry, something went wrong.

@mahakomar11
Copy link

I'm Windows user and I had the same issue. I installed graphviz through pip and then did the Step 4 from #163 (comment). It worked for me.

@jarrodmillman jarrodmillman added this to the 1.7 milestone Dec 25, 2020
@jarrodmillman jarrodmillman modified the milestones: 1.7, 1.8 Feb 1, 2021
@rossbar
Copy link
Contributor

rossbar commented Feb 2, 2021

Pygraphviz 1.7 was just released and should be easier to install on most common platforms. Graphviz must still be installed on the system first, but this should be much easier than it used to be for most platforms. See the updated installation guide for details, including recommended installation procedures for Windows, macOS, and popular Linux distros.

Fortunately, it seems most users had some luck with some of the solutions posted here. I'm going to close this as resolved - if you experience problems installing pygraphviz>=1.7, please open a new issue with info on the platform and how Graphviz was installed.

@umamahesh-gloify
Copy link

for windows 11
ERROR: Failed building wheel for pygraphviz
Failed to build pygraphviz
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pygraphviz)

@Matt-CAND
Copy link

Same as umamahesh-gloify.

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

No branches or pull requests