gak / pycallgraph

pycallgraph is a Python module that creates call graphs for Python programs.
GNU General Public License v2.0
1.82k stars 336 forks source link

pycallgraph.exceptions.PyCallGraphException #177

Open Integralist opened 6 years ago

Integralist commented 6 years ago

Hello,

I'm seeing this error with Python 3.6.1...

Traceback (most recent call last):
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/bin/pycallgraph", line 25, in <module>
    with __pycallgraph.PyCallGraph(config=__config):
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/lib/python3.6/site-packages/pycallgraph/pycallgraph.py", line 32, in __init__
    self.reset()
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/lib/python3.6/site-packages/pycallgraph/pycallgraph.py", line 53, in reset
    self.prepare_output(output)
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/lib/python3.6/site-packages/pycallgraph/pycallgraph.py", line 97, in prepare_output
    output.sanity_check()
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/lib/python3.6/site-packages/pycallgraph/output/graphviz.py", line 63, in sanity_check
    self.ensure_binary(self.tool)
  File "/Users/markmcdonnell/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/lib/python3.6/site-packages/pycallgraph/output/output.py", line 96, in ensure_binary
    'The command "{}" is required to be in your path.'.format(cmd))
pycallgraph.exceptions.PyCallGraphException: The command "dot" is required to be in your path.
reflash commented 6 years ago

@Integralist, I faced same issue, just install graphviz to your system, depending on OS you have to add dot.exe directory to PATH variable. After reloading command terminals opened everything worked fine.

Integralist commented 6 years ago

Awesome. Thanks @reflash

spatran137 commented 6 years ago

@reflash, So I clearly need some help with this. I am getting the same exception but I am not clear as to were to add the dot command or directory. Thank you.

reflash commented 6 years ago

@spatran137, Can you give some details? Not sure what problem you have. If you installed graphviz - then just find the directory path, where the dot.exe exists and add it to system PATH variable.

spatran137 commented 6 years ago

@reflash, So that was my issue I did not put the directory path in the system PATH variable. I was not thinking right I put it in the User variables. Once I put it in the system it worked. Thank you for your help.

ctrngk commented 6 years ago

debian: sudo apt-get install graphviz macos: brew install graphviz