Reputation: 21
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:
poetry add graphviz
poetry add dot
To confirm the installation of the packages, I run:
the shell-command poetry show graphviz
which outputs:
name : graphviz
version : 0.20.3
description : Simple Python interface for Graphviz
the shell-command poetry show dot
which outputs:
name : dot
version : 0.3.0
description : Providing context to models...
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)
?
[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:
PATH
environment-variable to which I added the path to the bin
folder of graphviz
is the one which is specific to the user, and not the system.Upvotes: 0
Views: 65