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

Unable to install pygraphviz (windows) #15

Open
ZeynabRostami opened this issue Jan 9, 2021 · 5 comments
Open

Unable to install pygraphviz (windows) #15

ZeynabRostami opened this issue Jan 9, 2021 · 5 comments

Comments

@ZeynabRostami
Copy link

ZeynabRostami commented Jan 9, 2021

Hi
First of all, thanks for such an amazing project.
I want to run the pretrained models but when I do It keeps showing this error:

Traceback (most recent call last):
File "C:\Python39\lib\site-packages\networkx\drawing\nx_agraph.py", line 279, in pygraphviz_layout
import pygraphviz
File "C:\Python39\lib\site-packages\pygraphviz_init_.py", line 56, in
from .agraph import AGraph, Node, Edge, Attribute, ItemAttribute, DotError
File "C:\Python39\lib\site-packages\pygraphviz\agraph.py", line 20, in
from . import graphviz as gv
File "C:\Python39\lib\site-packages\pygraphviz\graphviz.py", line 13, in
from . import _graphviz
ImportError: DLL load failed while importing _graphviz: The specified module could not be found.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\z.rostami\PycharmProjects\housegan\variation_bbs_with_target_graph_segments_suppl.py", line 232, in
graph_arr = draw_graph([real_nodes, eds.detach().cpu().numpy()])
File "C:\Users\z.rostami\PycharmProjects\housegan\variation_bbs_with_target_graph_segments_suppl.py", line 70, in draw_graph
pos = nx.nx_agraph.graphviz_layout(G_true, prog='neato')
File "C:\Python39\lib\site-packages\networkx\drawing\nx_agraph.py", line 237, in graphviz_layout
return pygraphviz_layout(G, prog=prog, root=root, args=args)
File "C:\Python39\lib\site-packages\networkx\drawing\nx_agraph.py", line 281, in pygraphviz_layout
raise ImportError("requires pygraphviz " "http://pygraphviz.github.io/") from e
ImportError: requires pygraphviz http://pygraphviz.github.io/

I spend a lot of time setting up Graphviz and pygraphviz successfully and I think I did! But the problem with pygraphviz still exists.
Isn't there any way to setup these libraries on Windows? Should I install Anaconda just for one library? Or install a VMware and clone the project in Linux ?! Has anyone installed pygraphviz in Windows?

@ennauata
Copy link
Owner

Hello @ZeinabRostami, I am not a windows user so I may not be able to help much, but I would try installing Anaconda. Overall I find Anaconda good for installing new packages so it could be helpful not only for pygrahviz, but for other packages you may want to install in the future.

@rickkk856
Copy link

1 - Make sure you downloaded Visual C/C++, e.g. from here: https://visualstudio.microsoft.com/visual-cpp-build-tools/

image

2 - Download and Install graphviz packagefiles https://gitlab.com/graphviz/graphviz/-/package_files/6164164/download

3 - Run in terminal
python -m pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz\include" --global-option="-LC:\Program Files\Graphviz\lib" pygraphviz

image

---------------- I made it using a conda enviroment

other sugestions like conda install graphviz pygraphviz did not work out.

@ZeynabRostami
Copy link
Author

ZeynabRostami commented Feb 10, 2021 via email

@lbertolotti
Copy link

Shouldn't there be a "pip install graphviz 64" or something like that?

@hhoppe
Copy link

hhoppe commented Feb 9, 2024

See also pygraphviz/pygraphviz#186

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

5 participants