'Dot cannot be run in Pycharm with Sphinx and Graphviz

I am trying to create a class diagram with sphinx. For this I created a virtual environment in Pycharm and added this to conf.py:

extensions = ['sphinx.ext.autodoc','sphinx.ext.inheritance_diagram']

In my spamfilter.rst file I added the following lines:

Diagrams
=================
.. inheritance-diagram:: spamfilter

The output is not a diagram and looks like this.

The following warning is displayed:

WARNING: dot command 'dot' cannot be run (needed for graphviz output), check the graphviz_dot setting

When I look into the folder C:\Users\Name\PycharmProjects\documentation\venv\Lib\site-packages\graphviz, there is a dot.py file, so I do not understand what is wrong. A similar question for Mac OS has been asked here. I tried the solution but it seems like it only works for Mac, because when I paste export PATH=$PATH:~/opt/bin to the Pycharm Terminal, it tells me that the command export could not be found. Honestly I have problems understanding why sometimes you can just use packages and other times they cannot be found even when they are installed, I am self-taught and a beginner.



Solution 1:[1]

The "pip install graphviz" command installs a Python package that provides an interface to Graphviz (https://pypi.org/project/graphviz). This package is not required by Sphinx.

In order to create inheritance diagrams with Sphinx, the actual Graphviz toolkit (including dot.exe) must be installed. See https://www.graphviz.org.

If dot.exe is not in the PATH, you can use the graphviz_dot configuration option.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mzjn