tcstyle
Posts: 10
Joined: Mon Jul 02, 2012 6:47 pm
Location: Hannover, Germany
Contact: Website

Anyone used cProfile yet for profiling?

Tue Jul 03, 2012 6:09 am

I tried to profile my game (see this thread) this morning with cProfile. This started my game as intended.
Unfortunately after quitting my game this raises an error that the module pstats is missing (that's true) in line 80 of cProfile.py. Has anyone an idea how to seolve this? Maybe get a newer more complete version of python? (On my other computers with python2.6 the module is in the standard installation of python.)

tcstyle
Posts: 10
Joined: Mon Jul 02, 2012 6:47 pm
Location: Hannover, Germany
Contact: Website

Re: Anyone used cProfile yet for profiling?

Thu Jul 05, 2012 8:36 am

After looking in the package descriptions of debian I found out that the python profiler is excluded from standard python. Looks like you have to get the python-profiler package, too, even if cProfile is in the standard python.

tcstyle
Posts: 10
Joined: Mon Jul 02, 2012 6:47 pm
Location: Hannover, Germany
Contact: Website

Re: Anyone used cProfile yet for profiling?

Fri Jul 06, 2012 3:35 pm

Manually installing the package worked.
If one is going to use cProfile, too, remember this:
Any path setting referring to the script's path via sys.path won't work as expected. The sys.path probably refers to the place cProfile is located.

Return to “Python”