尝试运行以下命令以使用pycallgraph生成调用图-
pycallgraph graphviz --output-file=/var/www/html/Reports/winmain.png -- token_check.py但是当我运行这个命令时,我得到了下面的错误。
pycallgraph.exceptions.PyCallGraphException: The command "dot -Tpng -o/var/www/html/Reports/winmain.png /tmp/tmpVDYnvE" failed with error code 256.请注意,我同时使用了'dot‘和graphviz。有谁能告诉我如何解决这个问题吗?
这是完整的回溯-
Traceback (most recent call last):
File "/usr/bin/pycallgraph", line 26, in <module>
exec(__file_content)
File "/usr/lib/python2.7/site-packages/pycallgraph/pycallgraph.py", line 38, in __exit__
self.done()
File "/usr/lib/python2.7/site-packages/pycallgraph/pycallgraph.py", line 81, in done
self.stop()
File "/usr/lib/python2.7/site-packages/pycallgraph/pycallgraph.py", line 90, in generate
output.done()
File "/usr/lib/python2.7/site-packages/pycallgraph/output/graphviz.py", line 112, in done
'code %(ret)i.' % locals())
pycallgraph.exceptions.PyCallGraphException: The command "dot -Tpng -o/var/www/html/Reports/winmain.png /tmp/tmpVDYnvE" failed with error code 256.发布于 2020-11-06 12:50:07
这对我很有效
转到/usr/lib/python2.7/site-packages/pycallgraph/output/graphviz.py
在-o和参数之间添加一个空格。也就是说,
在102行附近更改
cmd = '{} -T{} -o{} {}'.format(
self.tool, self.output_type, self.output_file, temp_name
)至
cmd = '{} -T{} -o {} {}'.format(
self.tool, self.output_type, self.output_file, temp_name
)https://stackoverflow.com/questions/49071423
复制相似问题