Closed rafascar closed 8 years ago
Hi !,
Do you have 'dot' executable in your PATH? Do you execute the script from the command line ?
Hi @himito, thanks for your reply!
What do you mean by 'dot executable'?
I added C:\Python27\Lib\site-packages\graphviz\dot.py
to my PATH and tried to run from the command line too but no success.
EDIT: I had only installed the graphviz python package, not on Windows. Now I've installed for windows and added the dot.exe
to my PATH, but no changes.
I mean http://www.graphviz.org/Download_windows.php :)
Note: As of version 2.31, the Visual Studio package no longer alters the PATH variable or accesses the registry at all. If you wish to use the command-line interface to Graphviz or are using some other program that calls a Graphviz program, you will need to set the PATH variable yourself.
Also, you could try to define the absolute path for value-0.png. Could you share your py file ?.
I installed GraphViz 2.38 and added the %programfiles(x86)%\Graphviz2.38\bin\dot.exe;
to my PATH, as well as creating a new environment variable GRAPHVIZ_DOT with the path as it is described here, but the error persisted :(
Here is the code I'm trying to run:
import snakes.plugins
snakes.plugins.load("gv", "snakes.nets", "nets")
from nets import *
def factory(cons, prod, init=[1, 2, 3]):
n = PetriNet("N")
n.add_place(Place('src', init))
n.add_place(Place('tgt', []))
t = Transition('t')
n.add_transition(t)
n.add_input('src', 't', cons)
n.add_output('tgt', 't', prod)
return n, t, t.modes()
net, trans, modes = factory(Variable('x'), Variable('x'))
net.draw('value-0.png', engine='dot')
Thank you!
EDIT: So I added C:\Program Files (x86)\Graphviz2.38\bin
to my PATH and now it works. Lol. Rookie mistake. Thank you @himito!
You are welcome :D @rafascar
Many thanks @himito for your help! I'm currently having holidays and I'm far away from a computer. I'm happy it works now! :-)
Thank you, guys!
Hi, please, I'm using python 3.8 with Pycharm IDE 2020.1.1 , I'm trying to use snakes but I can't load plugins (snakes.plugins.load("gv", "snakes.nets", "nets") from nets import *) if I pass the mouse on the load the message (You need configured Python 2 SDK to render Epydoc docstrings) is displayed. I don't know if that is the problem or there is another problem I try to install epydoc but the problem is not resolved; please can someone help me?
Hello,
I'm trying to draw my petri net using the Module
snakes.plugins.gv
but I'm running into this error everytime I try to call the methodPetriNet.draw
.To write the code I followed this example.
I've already searched and tried to fix it but no success. Any ideas?