gpt4 book ai didi

python - 如何解决 PyCallGraphException : The command "dot -Tpng -failed with error code 256 error?

转载 作者:行者123 更新时间:2023-12-03 21:24:49 24 4
gpt4 key购买 nike

尝试运行以下命令以使用 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.

最佳答案

这对我有用
转至 /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
)

关于python - 如何解决 PyCallGraphException : The command "dot -Tpng -failed with error code 256 error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49071423/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com