I'm encountering an error while trying to follow the quick start guide for the library. The error occurs when importing the Diagram class from the diagrams module.
Steps to Reproduce
Install Graphviz (already done)
Install diagrams using poetry: poetry add diagrams
Create a Python file with the following content:
from diagrams import Cluster, Diagram
Run the python file: poetry run python3 main.py
Traceback (most recent call last):
File "/Users/duc.nguyen/docs/main.py", line 1, in <module>
from diagrams import Cluster, Diagram
File "/Users/duc.nguyen/docs/.venv/lib/python3.9/site-packages/diagrams/__init__.py", line 40, in <module>
class Diagram:
File "/Users/duc.nguyen/docs/.venv/lib/python3.9/site-packages/diagrams/__init__.py", line 85, in Diagram
outformat: str | list[str] = "png",
TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'
I'm encountering an error while trying to follow the quick start guide for the library. The error occurs when importing the Diagram class from the diagrams module.
Steps to Reproduce
poetry add diagrams
poetry run python3 main.py