I want to use pycallgraph tool to track the functions call, but errors occur as below:
Traceback (most recent call last):
File "example.py", line 15, in <module>
graphviz = GraphvizOutput()
File "/home/russell/anaconda3/envs/tvm-build/lib/python3.7/site-packages/pycallgraph/output/graphviz.py", line 24, in __init__
Output.__init__(self, **kwargs)
File "/home/russell/anaconda3/envs/tvm-build/lib/python3.7/site-packages/pycallgraph/output/output.py", line 19, in __init__
[setattr(self, k, v) for k, v in kwargs.iteritems()]
AttributeError: 'dict' object has no attribute 'iteritems'
The code is:
from pycallgraph import PyCallGraph
from pycallgraph import Config
from pycallgraph.output import GraphvizOutput
graphviz = GraphvizOutput() ##error occurs
graphviz.output_file = 'regexp.png'
config = Config(include_stdlib=True)
The envirenments: python:3.7.16 pycallgraph:1.0.1 graphviz: enter image description here
I want to make this execute successfully and get the functions call relationship pic.
In Python 3, this method has been removed. items() is equivalent. [setattr(self, k, v) for k, v in kwargs.items()]