pycallgraph icon indicating copy to clipboard operation
pycallgraph copied to clipboard

Cannot run python3 code from the command line

Open ReagentX opened this issue 6 years ago • 4 comments

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.

ReagentX avatar Jul 09 '17 18:07 ReagentX

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

rawrgulmuffins avatar Aug 31 '17 00:08 rawrgulmuffins

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

jagibson avatar Aug 20 '18 21:08 jagibson

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?

YuntaoTan avatar Nov 29 '18 08:11 YuntaoTan

@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.

jagibson avatar Dec 03 '18 17:12 jagibson