473,382 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 10301
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carsten Gehling | last post by:
Figured out myself - I just removed the line with "from url import Url" -it doesn't seem to be used anywhere ;-) - Carsten > -----Oprindelig meddelelse----- > Fra:...
2
by: x-herbert | last post by:
Hi, I have a small test to "compile" al litle script as a WMI-Tester. The script include a wmi-wrapper and "insert" the Win32-modeles. here the code: my "WMI-Tester.py" ----- import wmi
0
by: M. Lavasani | last post by:
Hi I am trying to test Python-2.3. Any solution for this problem please: >>>gmake test case $MAKEFLAGS in \ *-s*)...
0
by: F. GEIGER | last post by:
py2exe and datetime -> No module named datetime I've begun to use the stdlib module datetime instead of my home brewn classes. Since then a py2exe app doesn't run anymore: Traceback (most...
1
by: fanbanlo | last post by:
What seems to be the matter? >>> path = "C:\\eclipse\\workspace\\moin134\\docbook\\xslt\\html\\db_compiled.dat" >>> f = file(path) >>> cPickle.load(f) Traceback (most recent call last):...
1
by: ye juan | last post by:
Hi, all I have some questions to ask: 1. How can I add a standard module named "datetime" in Jython when the error happens :"Traceback (innermost last): File "C:\python\test.py", line 3, in...
1
by: cpmishra | last post by:
Hi all I have used DBUtil with python2.4. when we run to program in dos command ,successfully run but when we run in apache server (locally)with modepython then given error.Pls help me error:...
2
by: emallove | last post by:
I'm running into the below "No modules named _sha256" issue, with a python installed in a non-standard location. $ python Python 2.5.2 (r252:60911, May 20 2008, 09:46:50) on linux2 Type...
0
by: Barak, Ron | last post by:
Hi, I'm trying to compile using py2exe, and am getting the following: $ python_win Setup.py py2exe running py2exe creating c:\Documents and Settings\rbarak\rbarak_devel\dpm09\build creating...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.