Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest profiling-svg doesn't work on python 2.7 #70

Closed
aurelBZH opened this issue Oct 16, 2017 · 7 comments
Closed

pytest profiling-svg doesn't work on python 2.7 #70

aurelBZH opened this issue Oct 16, 2017 · 7 comments
Assignees

Comments

@aurelBZH
Copy link

aurelBZH commented Oct 16, 2017

pytest --profiling work perfectly on python2.7 but the option --profiling-svg doesn't work. The profiling report is generated but the svg isn't . The error trace is :
test/test_standalone.py ..sh: 2: dot: not found Traceback (most recent call last): File "/home/aurelien/virtual_env/hotcountenv/bin/gprof2dot", line 11, in <module> sys.exit(main()) File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3319, in main dot.graph(profile, theme) File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3065, in graph arrowsize = "%.2f" % theme.edge_arrowsize(weight), File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3093, in edge self.attr_list(attrs) File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3110, in attr_list self.id(value) File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3123, in id self.write(s) File "/home/aurelien/virtual_env/hotcountenv/lib/python2.7/site-packages/gprof2dot.py", line 3147, in write self.fp.write(s) IOError: [Errno 32] Broken pipe

@emorikawa
Copy link

emorikawa commented Feb 27, 2018

I also get the same error on OSX python 2.7.10

h: line 1: dot: command not found
Traceback (most recent call last):
  File "/Users/evanmorikawa/Code/cloud-core/.venv/bin/gprof2dot", line 11, in <module>
    sys.exit(main())
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3319, in main
    dot.graph(profile, theme)
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3037, in graph
    tooltip = function.filename,
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3085, in node
    self.attr_list(attrs)
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3110, in attr_list
    self.id(value)
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3123, in id
    self.write(s)
  File "/Users/evanmorikawa/Code/cloud-core/.venv/lib/python2.7/site-packages/gprof2dot.py", line 3147, in write
    self.fp.write(s)
IOError: [Errno 32] Broken pipe

@emorikawa
Copy link

I was able to just run everything manually to get around this:

gprof2dot -f pstats prof/combined.prof | dot -Tsvg -o prof/combined.svg

Note on OSX I had to first brew install graphviz to get the dot cli arg.

@eeaston eeaston self-assigned this Mar 8, 2018
@eeaston
Copy link
Collaborator

eeaston commented Mar 8, 2018

Hi guys - thanks for raising this. The problem is that the dot executable from the graphviz package needs to be on your $PATH. This isn't clear in the README, neither does it raise a sensible error message so I'll try and make this better.

@kalefranz
Copy link

conda install graphviz fixed this for me.

@naught101
Copy link

python 2.7 is at end of life in less than 6 months.

@eeaston
Copy link
Collaborator

eeaston commented Nov 19, 2021

Hello - sorry all, we're dropping support for python2.7 so I'm closing this issue now.

@eeaston eeaston closed this as completed Nov 19, 2021
@danieltanfh95
Copy link

on mac brew install graphviz is still needed even in python 3.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants