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

Deprecate pydot? #5723

Closed
jarrodmillman opened this issue Jun 10, 2022 · 15 comments · Fixed by #7204
Closed

Deprecate pydot? #5723

jarrodmillman opened this issue Jun 10, 2022 · 15 comments · Fixed by #7204
Labels
Discussion Issues for discussion and decision making Pydot Items related to pydot dependency

Comments

@jarrodmillman
Copy link
Member

jarrodmillman commented Jun 10, 2022

In #5721, we added a PendingDeprecationWarning for nx.nx_pydot.*. It has a number of issues and isn't actively maintained. We are also planning to improve installation issues for pygraphviz. This is a tracking issue to gather feedback from users.

Please leave a comment if you have feelings either way about this change.

@MridulS MridulS pinned this issue Jun 13, 2022
@rossbar rossbar added Discussion Issues for discussion and decision making Pydot Items related to pydot dependency labels Jun 27, 2022
@cans
Copy link

cans commented Jun 29, 2022

We are also planning to improve installation issues for pygraphviz.

Do you mean providing wheel package for pygraphviz? I know I had colleagues having trouble building/installing the package on MacOS. That would be awesome!

@naught101
Copy link

I looked at the PR mentioned, and it looks like the deprecation warning for nx.nx_pydot.pydot_layout doesn't suggest a replacement. Is there a way to use pygraphviz via networkx for generating graph layouts? If not, please don't deprecate yet - those layout generators are seriously useful (e.g. the spring layouts are much better than the native networkx ones, as far as I can tell).

@naught101
Copy link

Ah, I see nx.nx_agraph.pygraphviz_layout exists - perhaps those could be added to the deprecation message?

chrizzFTD added a commit to thegrill/grill that referenced this issue Nov 20, 2022
* Use nx_agraph via pygraphviz instead of nx_pydot via pydot. networkx/networkx#5962 and networkx/networkx#5723
stephanlukasczyk added a commit to se2p/pynguin that referenced this issue Jan 13, 2023
The nx_pydot library from NetworkX is deprecated from NetworkX' latest
major release, see [1].  To get rid of the dependency we implement a
simple DOT generation on our own which fits our minimal needs
(basically, the DOT output is only useful for debugging of our internal
graphcs).

[1] networkx/networkx#5723
@roel-v
Copy link

roel-v commented Mar 2, 2023

On Windows, it's really hard to get pygraphviz to work. I very much prefer a lightweight tool that only outputs a Graphviz dotfile and then lets me run the Graphviz binary from a script to render diagrams from it myself. I'm not sure what the issues with pydot are, but from my perspective as a user, pygraphviz and pydot may overlap somewhat but still fulfill two different needs. If pydot support actually gets removed I'd be SOL wrt network visualization.

@dschult
Copy link
Member

dschult commented Mar 2, 2023

Thanks for this comment!
As you may have gathered, our concern with pydot is that it doesn't seem to be maintained anymore. We've started to have bug reports that might just never be fixed. We've been working pretty hard on getting pygraphviz to be easier to install on Windows. But there are understandable limitations when using a program with such a storied history like Graphviz.

Our support for pydot depends on comments like this one. So thank you.

@goyalyashpal
Copy link

goyalyashpal commented Apr 14, 2023

umh, i just want to render my graph/network from python script to terminal as inline image, how to do that 😅 ?

My trail for reaching here:


[NX's] main goal is to enable graph analysis rather than perform graph visualization. In the future, graph visualization functionality may be removed from NetworkX or only available as an add-on package.
Proper graph visualization is hard, and we highly recommend that people visualize their graphs with tools dedicated to that task.
- NX/Reference/Drawing

@goyalyashpal

This comment was marked as off-topic.

@dschult
Copy link
Member

dschult commented Apr 14, 2023

Are you saying you want to render the graph in the terminal window? (we have ascii representations of graphs #5602 )

If you mean you want to render the graph from a terminal-based script, we will continue to support pygraphviz which creates dot files. We are definitely not cutting off support for interaction with GraphViz.

And if you don't need the graphviz features, the matplotlib-based tools we offer will continue in the long term. So, basic image creation is supported. But we aren't able to support all the features of a full-fledged graph visualization tool.

Perhaps we should update the comments in the NX/Reference/Drawing section to make it more clera that basic rrawing will continue to be available via networkx. :}

@goyalyashpal
Copy link

goyalyashpal commented Apr 14, 2023

we have ascii representations of graphs #5602

the text based thing is nice, i wanted to experiment with that too. thanks for sharing it.

Are you saying you want to render the graph in the terminal window?

nope, i was saying that

  • to render an image file from graph (i.e. static image, not in a separate window like matplotlib.plot.show() which opens an interactive widget
  • the rest of the part is covered thereafter by imgcat module which you don't have to worry about 😃

@goyalyashpal
Copy link

goyalyashpal commented Apr 14, 2023

oh, i

  • missed sharing one part of why i dabbled into weeds of this networkx.drawing.nx_pydot.to_pydot(my_networkx_graph) method

Have shared the following at: #6638 . Please add your input related to this over there. Thanks 😃

  • 'ts that the ms-python.vscode-pylance (python LS for VSCode) is showing errors with networkx.draw related functions

(wait, i am getting the details of it) see below

"draw" is not a known member of module "networkx" Pylance reportGeneralTypeIssues
(function) draw: Unknown

"draw_networkx" is not a known member of module "networkx" Pylance reportGeneralTypeIssues
(function) draw_networkx: Unknown

@dschult
Copy link
Member

dschult commented Apr 14, 2023

I believe matplotlib can save the figure without drawing it interactively.
Maybe use matplotlib.pyplot.savefig instead of matplotlib.pyplot.show. There may be other ways too. They definitely allow image file creation without any interactive UI.

@fzzylogic
Copy link

fzzylogic commented Jun 16, 2023

Just to put a good word in for leaving pydot around for a while, it works on in-browser systems like Jupyter Lite, whereas pygraphviz would not be possible to use there without additional effort compiling a WASM version.

@rossbar
Copy link
Contributor

rossbar commented Jun 16, 2023

it works on in-browser systems like Jupyter Lite, whereas pygraphviz would not be possible

This is true since pydot is pure Python, though it's worth noting that:

  1. You'd only be able to produce dot files - converting to actual image formats (e.g .png) would require graphviz to be installed (not sure how difficult this is for in-browser systems), and
  2. It "works" in the sense that it is installable, but there are many defects related to updates to pyparsing that pydot never incorporated as it has been unmaintained for nearly 2 years.

@lkk7
Copy link

lkk7 commented Dec 30, 2023

@jarrodmillman @MridulS @rossbar A new pydot version has been released which should fix the breaking issues!

I'm not sure what's the current state of pydot in networkx, but I'm just letting you know that if you'd want to bring it back, you could try 😄

@rossbar
Copy link
Contributor

rossbar commented Jan 4, 2024

Thanks @lkk7 , that's great news! I'm very much in favor of keeping NX's interface to pydot around now that it's actively maintained and working again. I went ahead and tested nx_pydot against pydot 2.0 and indeed the original issues we had seen related to pyparsing 3.0 release have been resolved.

I opened #7204 to propose un-deprecating nx_pydot. Thanks for the heads up and the latest round of maintenance!

@jarrodmillman jarrodmillman unpinned this issue Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issues for discussion and decision making Pydot Items related to pydot dependency
Development

Successfully merging a pull request may close this issue.

9 participants