Recursion-Tree-Visualizer
Recursion-Tree-Visualizer copied to clipboard
Error while writing fibonacci.png
trafficstars
I copied the fibonacci code and saved it as code.py file and tried to run but it failed to make png file and gif file but it created a folder "frames" and "fibonacci.gif" file. Would you please help me fix the issue?
# Import Visualiser class from module visualiser
from visualiser.visualiser import Visualiser as vs
# Add decorator
# Decorator accepts optional arguments: ignore_args , show_argument_name, show_return_value and node_properties_kwargs
@vs(node_properties_kwargs={"shape":"record", "color":"#f57542", "style":"filled", "fillcolor":"grey"})
def fib(n):
if n <= 1:
return n
return fib(n=n - 1) + fib(n=n - 2)
def main():
# Call function
print(fib(n=6))
# Save recursion tree to a file
vs.make_animation("fibonacci.gif", delay=2)
if __name__ == "__main__":
main()
Error:
8
Starting to make animation
Writing fibonacci.png failed
Writing frames....
Error writing frames
Writing gif...
Error saving gif.
Installation:
imageio==2.6.1
pydot==1.4.1
recursion-visualiser==1.0.2
Tried following version of graphviz with above installation:
graphviz-2.50.0 (32-bit)
graphviz-2.50.0 (64-bit)
and also added graphviz bin dir path to system path variable and successfully verified it using dot -V
Did you try the solution from the pinned issue? Also, what OS and Python version are you using?
Yes I tried the solution from the pinned issue.
Python version: 3.8.5
OS: Windows 11 Home Single Language