I had the same problem. As far as I can tell, the RunSnakeRun package has not been ported to Python3. At least I could pass it to python2, but not to python3 (SyntaxError). Also, I think the cProfile output format is incompatible between python 2/3. I did not find time to find a final confirmation of this, but in the document cProfile class pstats.Stats (* filenames, stream = sys.stdout) , they say: "The file selected by the above constructor must be created with the appropriate version of the profile or cProfile. In particular, there is no file compatibility with future versions of this profiler, and no compatibility with files created by other profilers. " This seems to be causing your problem. For example, I made a profile obtained from python3
import cProfile cProfile.run('some code to profile', 'restats')
and tried to open it in RunSnakeRun and got the same marshal error as you. Also, if I do
import pstats p = pstats.Stats('restats') p.strip_dirs().sort_stats(-1).print_stats()
in python3, it works like a charm. If I do this in python2, it will give a marshal error. Now RunSnakeRun is executed in python2 (if you have not found a way to run it in python3). So, I assume that you have completed your profiling in python3 and are using tools relying on python2 to analyze them, which tools expect the output to be compatible with python2.
The RunSnakeRun project seems to be inactive for a while (copyrights to pyprof2calltree in combination with KCachegrind worked fine for me on Linux. It can provide a similar visual view of the profiling output as you could get from RunSnakeRun.
Christian O'Reilly
source share