{"id":6792,"library":"pydot-ng","title":"pydot-ng: Python interface to Graphviz's Dot (Archived)","description":"Pydot-ng is an archived Python interface to Graphviz's Dot language, enabling programmatic creation, manipulation, and rendering of graphs. It was originally created to provide Python 2 and 3 compatibility as a fork of the original pydot. The last stable version is 2.0.0, released in October 2018. This project is no longer actively maintained, and users are strongly advised to use the actively developed `pydot` library instead.","status":"abandoned","version":"2.0.0","language":"en","source_language":"en","source_url":"https://github.com/pydot/pydot-ng","tags":["graphviz","dot","visualization","graph","archived","abandoned"],"install":[{"cmd":"pip install pydot-ng","lang":"bash","label":"Install pydot-ng"}],"dependencies":[{"reason":"Required for parsing DOT files.","package":"pyparsing","optional":false},{"reason":"System dependency: Required to render graphs into various output formats (e.g., PNG, SVG). Must be installed separately on the system and its executables (like 'dot') added to the system's PATH environment variable.","package":"Graphviz","optional":false}],"imports":[{"note":"While 'import pydot_ng as pydot' was a common pattern for API compatibility with the original pydot, direct import is 'pydot_ng'. However, given the project's archived status, it's recommended to use the actively maintained `pydot` library directly (i.e., `import pydot`).","wrong":"import pydot","symbol":"pydot_ng","correct":"import pydot_ng"},{"note":"This would be the correct way to import the Graph class from pydot-ng, though using `import pydot_ng as pydot` and then `pydot.Graph` was more common for compatibility.","symbol":"Graph","correct":"from pydot_ng import Graph"},{"note":"This would be the correct way to import the Node class from pydot-ng.","symbol":"Node","correct":"from pydot_ng import Node"},{"note":"This would be the correct way to import the Edge class from pydot-ng.","symbol":"Edge","correct":"from pydot_ng import Edge"}],"quickstart":{"code":"import pydot_ng as pydot\nimport os\n\n# NOTE: pydot-ng is archived. It is highly recommended to use 'pydot' instead.\n# For Graphviz to work, ensure it is installed on your system and 'dot' is in your PATH.\n# On Linux: sudo apt-get install graphviz\n# On macOS: brew install graphviz\n# On Windows: Download from graphviz.org and add 'bin' to PATH.\n\n# Create a graph\ngraph = pydot.Dot('my_graph', graph_type='digraph')\n\n# Add nodes\nnode_a = pydot.Node('A', style='filled', fillcolor='red')\nnode_b = pydot.Node('B', style='filled', fillcolor='green')\nnode_c = pydot.Node('C', style='filled', fillcolor='blue')\n\ngraph.add_node(node_a)\ngraph.add_node(node_b)\ngraph.add_node(node_c)\n\n# Add edges\ngraph.add_edge(pydot.Edge(node_a, node_b))\ngraph.add_edge(pydot.Edge(node_b, node_c, label='Connects'))\n\n# Save the graph to a file\ntry:\n    # Using a temporary file for demonstration\n    output_file = 'quickstart_graph.png'\n    graph.write_png(output_file)\n    print(f\"Graph saved to {output_file}\")\nexcept Exception as e:\n    print(f\"Error generating graph: {e}\")\n    print(\"Please ensure Graphviz is installed and its 'dot' executable is in your system's PATH.\")\n\n# Clean up the generated file for demonstration purposes (optional)\n# if os.path.exists(output_file):\n#     os.remove(output_file)\n","lang":"python","description":"This quickstart demonstrates how to create a simple directed graph with nodes and edges using pydot-ng and save it as a PNG image. It includes important warnings about the project's archived status and the Graphviz system dependency. For new projects, use the 'pydot' library."},"warnings":[{"fix":"Migrate your codebase to use the `pydot` library. Install with `pip install pydot` and update imports from `pydot_ng` to `pydot`.","message":"The pydot-ng project is archived and read-only. It is no longer maintained. Users should migrate to the actively developed `pydot` library (PyPI: `pydot`, GitHub: `pydot/pydot`).","severity":"breaking","affected_versions":"All versions (from 2.0.0 onwards, implicitly)"},{"fix":"Install Graphviz from its official website (graphviz.org) or via your system's package manager (e.g., `sudo apt-get install graphviz` on Debian/Ubuntu, `brew install graphviz` on macOS). Then, ensure the directory containing the Graphviz executables is added to your system's PATH.","message":"Graphviz (the underlying graph visualization software) must be installed separately on your system, and its executable files (e.g., `dot`, `neato`) must be accessible via your system's PATH environment variable. Pydot-ng (and pydot) will not work without a correctly configured Graphviz installation.","severity":"gotcha","affected_versions":"All versions of pydot-ng"},{"fix":"Switch to using the `pydot` library, which is actively maintained and compatible with modern Python versions (e.g., Python 3.9+).","message":"pydot-ng was a fork of pydot to support both Python 2 and 3. The original `pydot` project has since been updated to support Python 3+ and the `pydot-ng` repository explicitly directs users to `pydot`. Continued use of `pydot-ng` may lead to compatibility issues with newer Python versions or lack of bug fixes.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Ensure Graphviz is properly installed and its `bin` directory is in the system PATH. For persistent issues, consider using the active `pydot` library, which likely has improved executable detection.","message":"Older versions of pydot-ng might have issues locating Graphviz executables, particularly on Windows, sometimes looking for `.bat` files instead of `.exe`.","severity":"gotcha","affected_versions":"<= 2.0.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}