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.
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?
Error:
Installation:
Tried following version of graphviz with above installation:
and also added graphviz bin dir path to system path variable and successfully verified it using
dot -V