[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

No Module Named pstats

Juha S.

2/13/2008 9:20:00 AM

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.
4 Answers

Chris

2/13/2008 9:42:00 AM

0

On Feb 13, 11:20 am, "Juha S." <s...@iloinen.net> wrote:
> 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 ?

Joshua J. Kugler

2/13/2008 7:08:00 PM

0

Chris wrote:

> On Feb 13, 11:20 am, "Juha S." <s...@iloinen.net> wrote:
>> 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


mr.rapidan

11/16/2011 1:03:00 AM

0

On Tuesday, November 15, 2011 7:42:30 PM UTC-5, James Pablos wrote:
> On Nov 15, 7:16 pm, band beyond description
> <shadowbo...@apocalypse.com> wrote:
>
> > obligatory Japanese pizza reference:
> >
> > http://www.pizza-la.co.jp/MenuEn...
>
> Do they still eat horse meat in Japan?

Nay.

james.pablos

11/16/2011 2:25:00 AM

0

On Nov 15, 8:03 pm, band beyond description
<shadowboxing....@apocalypse.com> wrote:
> James Pablos <james.pab...@gmail.com> wrote:

> > Do they still eat horse meat in Japan?
>
> not as much as in France or a whole host of other places...

That's an oddly defensive answer....