gak / pycallgraph

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

Cannot run python3 code from the command line #170

Open ReagentX opened 7 years ago

ReagentX commented 7 years ago

There is no argument in the documentation that allows you to specify a different command other than python to run the code, so this will always run Python 2.7 instead of Python 3.x.

rawrgulmuffins commented 7 years ago

Seconding thing running on python3.5.

 pycallgraph graphviz -- test.py
Traceback (most recent call last):
  File "/home/alex/.virtualenvs/pycallgraph/bin/pycallgraph", line 26, in <module>
    exec(__file_content)
  File "<string>", line 800
    print v.to_dot(draw_defines=options.draw_defines,
          ^
SyntaxError: invalid syntax
jagibson commented 6 years ago

A workaround is to use virtualenv

$ virtualenv -p /usr/bin/python3 .virtualenv
$ source .virtualenv/bin/activate
$ python --version
Python 3.6.5
$ pip install pycallgraph
YuntaoTan commented 5 years ago

I try to use python3.3 , but i get following warning: `(process:11443): Pango-CRITICAL **: 16:38:25.373: pango_cairo_show_layout: assertion 'PANGO_IS_LAYOUT (layout)' failed

(process:11443): Pango-CRITICAL **: 16:38:25.373: pango_cairo_show_layout: assertion 'PANGO_IS_LAYOUT (layout)' failed

(process:11443): Pango-CRITICAL **: 16:38:25.373: pango_cairo_show_layout: assertion 'PANGO_IS_LAYOUT (layout)' failed

(process:11443): Pango-CRITICAL **: 16:38:25.373: pango_cairo_show_layout: assertion 'PANGO_IS_LAYOUT (layout)' failed

(process:11443): Pango-CRITICAL **: 16:38:25.373: pango_cairo_show_layout: assertion 'PANGO_IS_LAYOUT (layout)' failed` and i get following ugly picture: test @jagibson can you help me, or any person can help me?

jagibson commented 5 years ago

@YuntaoTan I'm certainly not an expert on this project - however with those errors I would check that you have the libpango and libcairo2 OS libraries installed.