470,641 Members | 1,377 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

No Module Named pstats

Hi,

I'm trying to use the Python profilers to test my code, but I get the
following output for cProfile.run() at the interpreter:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/cProfile.py", line 36, in run
result = prof.print_stats(sort)
File "/usr/lib/python2.5/cProfile.py", line 80, in print_stats
import pstats
ImportError: No module named pstats
I also tried to use the profile module but I get:
>>import profile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named profile
I'm on Ubuntu 7.10 with Python 2.5, and I can't seem to figure out
what's missing.
Feb 13 '08 #1
2 10136
On Feb 13, 11:20 am, "Juha S." <s...@iloinen.netwrote:
Hi,

I'm trying to use the Python profilers to test my code, but I get the
following output for cProfile.run() at the interpreter:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/cProfile.py", line 36, in run
result = prof.print_stats(sort)
File "/usr/lib/python2.5/cProfile.py", line 80, in print_stats
import pstats
ImportError: No module named pstats

I also tried to use the profile module but I get:
>>import profile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named profile

I'm on Ubuntu 7.10 with Python 2.5, and I can't seem to figure out
what's missing.
There is no module called 'profile', it's called 'cProfile'. Both
'cProfile' and 'pstats' are part of the standard distro, have you
tried downloading a new binary and installing it ?
Feb 13 '08 #2
Chris wrote:
On Feb 13, 11:20 am, "Juha S." <s...@iloinen.netwrote:
>Hi,

I'm trying to use the Python profilers to test my code, but I get the
following output for cProfile.run() at the interpreter:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/cProfile.py", line 36, in run
result = prof.print_stats(sort)
File "/usr/lib/python2.5/cProfile.py", line 80, in print_stats
import pstats
ImportError: No module named pstats

I also tried to use the profile module but I get:
> >>import profile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named profile

I'm on Ubuntu 7.10 with Python 2.5, and I can't seem to figure out
what's missing.

There is no module called 'profile', it's called 'cProfile'. Both
'cProfile' and 'pstats' are part of the standard distro, have you
tried downloading a new binary and installing it ?
There is a module called profile, as well as cProfile. And as Ilias said,
you probably do have to install python-profile (or whatever package your
system places the profiler in).

j
Feb 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Carsten Gehling | last post: by
reply views Thread by M. Lavasani | last post: by
1 post views Thread by fanbanlo | last post: by
1 post views Thread by cpmishra | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.