{"id":1819,"library":"diagrams","title":"Diagrams","description":"Diagrams is a Python library that allows users to draw cloud system architectures and other technical diagrams as code. It leverages Graphviz to render visual representations, enabling version-controlled, reproducible, and dynamic documentation for multi-cloud deployments (AWS, Azure, GCP, Kubernetes, etc.), on-premise solutions, and more. Currently at version 0.25.1, the library maintains an active release cadence with frequent updates adding new icons and features.","status":"active","version":"0.25.1","language":"python","source_language":"en","source_url":"https://github.com/mingrammer/diagrams","tags":["diagrams","architecture","cloud","graphviz","visualization","devops","infrastructure-as-code","documentation"],"install":[{"cmd":"pip install diagrams","lang":"bash","label":"Install Python package"},{"cmd":"brew install graphviz","lang":"bash","label":"Install Graphviz (macOS Homebrew)"},{"cmd":"sudo apt-get install graphviz","lang":"bash","label":"Install Graphviz (Debian/Ubuntu)"},{"cmd":"choco install graphviz","lang":"bash","label":"Install Graphviz (Windows Chocolatey)"}],"dependencies":[{"reason":"Graphviz is a required system-level dependency for rendering diagrams. It must be installed separately from the Python package.","package":"Graphviz","optional":false}],"imports":[{"symbol":"Diagram","correct":"from diagrams import Diagram"},{"note":"Node types are imported from their respective cloud/provider sub-modules (e.g., `diagrams.aws`, `diagrams.azure`, `diagrams.gcp`).","symbol":"EC2","correct":"from diagrams.aws.compute import EC2"}],"quickstart":{"code":"from diagrams import Diagram\nfrom diagrams.aws.compute import EC2\nfrom diagrams.aws.database import RDS\nfrom diagrams.aws.storage import S3\n\nwith Diagram(\"Simple Web Application\", show=False, filename=\"simple_web_app\"):\n    web_server = EC2(\"Web Server\")\n    database = RDS(\"Database\")\n    static_storage = S3(\"Static Content\")\n\n    web_server >> database\n    web_server >> static_storage\n","lang":"python","description":"This example generates a simple AWS web application diagram, saving it as 'simple_web_app.png' in the current directory without automatically opening the image."},"warnings":[{"fix":"Install Graphviz according to your OS (e.g., `brew install graphviz` on macOS, `sudo apt-get install graphviz` on Debian/Ubuntu, download installer for Windows). Ensure the `dot` executable is in your system's PATH.","message":"The `diagrams` Python package requires the Graphviz system-level tool to be installed on your operating system. Without Graphviz, diagrams cannot be rendered, and you will encounter errors. This is a common oversight.","severity":"gotcha","affected_versions":"All versions"},{"fix":"While `diagrams` itself will still function, be aware of the unnecessary dependencies. This issue is likely to be addressed in a future patch release. For production environments, consider pinning to a version prior to 0.25.1 or waiting for a fix, if this is a concern.","message":"In version 0.25.1, the `pre-commit` development dependency was incorrectly included as a runtime dependency in the PyPI package. This means `pre-commit` and its transitive dependencies will be installed for all users of the library, increasing installation size and potentially causing conflicts.","severity":"gotcha","affected_versions":"0.25.1"},{"fix":"Ensure your environment uses Python 3.9 or a newer compatible version.","message":"Diagrams requires Python 3.9 or higher. Using it with older Python versions will result in compatibility errors.","severity":"breaking","affected_versions":"< 0.25.1 (earlier versions supported Python 3.7+)"}],"env_vars":null,"search_vec":"'0.25.1':55 'activ':60 'ad':66 'allow':8 'architectur':14,72 'aw':41 'azur':42 'cadenc':62 'cloud':12,39,73 'code':20,80 'control':31 'current':52 'deploy':40 'devop':76 'diagram':1,2,18,71 'document':35,81 'draw':11 'dynam':34 'enabl':28 'etc':45 'featur':70 'frequent':64 'gcp':43 'graphviz':23,74 'icon':68 'infrastructur':78 'infrastructure-as-cod':77 'kubernet':44 'leverag':22 'librari':6,57 'maintain':58 'multi':38 'multi-cloud':37 'new':67 'on-premis':46 'premis':48 'python':5 'releas':61 'render':25 'represent':27 'reproduc':32 'solut':49 'system':13 'technic':17 'updat':65 'user':9 'version':30,54 'version-control':29 'visual':26,75","created_at":"2026-04-09T05:06:37.461944+00:00","updated_at":"2026-04-16T14:24:56.754528+00:00","problems":[{"fix":"Ensure the 'diagrams' package is installed using pip: `pip install diagrams`.","cause":"The 'diagrams' Python package is not installed in the environment where the code is being run, or the Python interpreter cannot find it.","error":"ModuleNotFoundError: No module named 'diagrams'"},{"fix":"Install Graphviz on your operating system (e.g., `brew install graphviz` on macOS, `sudo apt-get install graphviz` on Ubuntu/Debian, or download from graphviz.org for Windows) and ensure its 'bin' directory is added to your system's PATH. Restart your terminal or IDE after modifying the PATH.","cause":"The 'diagrams' library relies on the external Graphviz software to render diagrams, but the Graphviz executable ('dot') is either not installed on your system or its location is not included in your system's PATH environment variable.","error":"graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng'], make sure the Graphviz executables are on your systems' PATH"},{"fix":"Install Graphviz on your operating system (e.g., `brew install graphviz` on macOS, `sudo apt-get install graphviz` on Ubuntu/Debian, or download from graphviz.org for Windows) and ensure its 'bin' directory is added to your system's PATH. Restart your terminal or IDE after modifying the PATH. Additionally, verify `pydot` is installed via `pip install pydot` or `conda install pydot`.","cause":"Similar to `ExecutableNotFound`, this error indicates that the `pydot` library (often used by `diagrams` or other graphing libraries) cannot locate the Graphviz executables, meaning Graphviz is either not installed or not in the system's PATH.","error":"pydot.InvocationException: GraphViz's executables not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.25.1","cli_name":"diagrams","cli_version":"usage: diagrams [-h] path [path ...]","type":"library","homepage":"https://diagrams.mingrammer.com","github":"https://github.com/mingrammer/diagrams","docs":null,"changelog":null,"pypi":"https://pypi.org/project/diagrams/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","aws","gcp","azure"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}