nedhos
nedhos

Reputation: 21

Not able to use `graphviz` to generate `.png` files, when using `pyreverse` and `poetry`

For context, I am using poetry as the package-manager (and a dependency-manager).

I have installed both graphviz and dot packages (i.e. libraries) in a virtual-environment used by my project, using the following shell-commands:

To confirm the installation of the packages, I run:



I use the tool called pyreverse (which is defined in the package called pylint), which in turn uses the package (i.e. library) graphviz to generate a file that represents a class-diagram.

When I use it to generate a file with the extension .dot (which is done by default), there are no problems. Here is the example of a shell-command which I use: pyreverse --all-ancestors --only-classnames --verbose ./root_folder

However, when I try to use pyreverse to directly generate a file with extension .png, by using the following shell-command pyreverse -o png --all-ancestors --only-classnames --verbose ./root_folder, I get the following error 'Graphviz' needs to be installed for your chosen output format..



I am building a repo which would be run on different devices (which use different OS), and the goal of using pyreverse is to generate a class-diagram (and integrate it in the redme.md file of the repo) every time there is a push to the remote repo.

I read two articles which are explaining that beside a standard installation of the package (i.e. library) graphviz through a package-manager, you are supposed to download another file from the internet, and add it to the PATH (user) environment-variable. I guess that this is the part where I am struggling, and the reason why graphviz is not working for me.

Although I knew that my code would be used on multiple machines (with different OS-s), I thought to try downloading the latest file from the homepage of graphviz (for context, I am using a machine which uses Windows), unzip it, and add the path to its bin folder to the environment-variables, but it still didn't work for me.



Can you please help me understand why am I facing the issue, and what is the way to solve it?

Is the problem cause by using a poetry (or more specifically, a virtual-environment)?

Does it matter if downloaded the file from the homepage of graphviz in the Program Files folder (and added the path to its bin folder which is inside the Program Files folder), and not the Program Files (x86)?


Here are similar discussions:

[UPDATE] When I try running where graphviz I get the message graphviz not found, and when I run the shell-command where dot I get the message dot not found.

For context:

Upvotes: 0

Views: 65

Answers (0)

Related Questions