Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > cProfile.py not found.

Reply
Thread Tools

cProfile.py not found.

 
 
Rahul
Guest
Posts: n/a
 
      04-04-2009
I need to profile a slow-running code. The problem is I cannot seem to find
cProfile.py.

Where can I get it? Is it not included in the normal distro? I tried
googling it up and theres tons of info on how to use it but no links for
where to download it from.

I am using Python 2.4.4 (#3, Feb 17 2008, 15:06:10).

I am aware this is kind of dated but some of our legacy codes insist on
using that exact version.


--
Rahul
 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      04-04-2009
On 2009-04-04 17:46, Rahul wrote:
> I need to profile a slow-running code. The problem is I cannot seem to find
> cProfile.py.
>
> Where can I get it? Is it not included in the normal distro? I tried
> googling it up and theres tons of info on how to use it but no links for
> where to download it from.
>
> I am using Python 2.4.4 (#3, Feb 17 2008, 15:06:10).
>
> I am aware this is kind of dated but some of our legacy codes insist on
> using that exact version.


What system are you on? Some Linux distributions put it into a separate package,
like python-profile. The python.org Windows and Mac binaries should have it, though.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

 
Reply With Quote
 
 
 
 
John Yeung
Guest
Posts: n/a
 
      04-04-2009
I believe cProfile was added in 2.5. Your best bet on 2.4 is probably
the profile module. That is what the docs recommend.

John
 
Reply With Quote
 
Rahul
Guest
Posts: n/a
 
      04-04-2009
Robert Kern <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> What system are you on? Some Linux distributions put it into a
> separate package, like python-profile. The python.org Windows and Mac
> binaries should have it, though.
>
>


THanks Robert. I'm on RHEL.

Tried yum search python-profile. No hits. Also tried a locate on
cProfile. No hits again.

Did a yum search python. Huge list but nothing promising. Yet, I
reproduce it below just in case its hidden somewhere in the list. What
options do I have now?

python-sqlite2.i386 : DB-API 2.0 interface for SQLite 3.x
tix.i386 : A set of extension widgets for Tk
tix-devel.i386 : Tk Interface eXtension development files
tix-doc.i386 : Tk Interface eXtension documentation
vim-enhanced.i386 : A version of the VIM editor which includes recent
: enhancements.
Django.noarch : A high-level Python Web framework
Django-doc.noarch : Documentation for Django
MySQL-python.i386 : An interface to MySQL
OpenIPMI-python.i386 : OpenIPMI Python language bindings
PyQt.i386 : Python bindings for Qt
PyQt-examples.i386 : Examples for PyQt
PyXML.i386 : XML libraries for python.
PyYAML.noarch : YAML parser and emitter for Python
Pyrex.noarch : A compiler/language for writing Python extension modules.
PythonCard.noarch : PythonCard GUI construction toolkit
R2spec.noarch : Python script to generate R spec file
SOAPpy.noarch : Full-featured SOAP library for Python
TurboGears.noarch : Back-to-front web development in Python
ant-scripts.i386 : Additional scripts for ant
archivemail.noarch : A tool for archiving and compressing old email in
mailboxes
audit-libs-python.i386 : Python bindings for libaudit
babel.noarch : Tools for internationalizing Python applications
beecrypt-python.i386 : Files needed for python applications using
beecrypt.
booty.noarch : simple python bootloader config lib
bsf.i386 : Bean Scripting Framework
cobbler.noarch : Boot server configurator
ctopy.noarch : C to Python translator
cvs2svn.noarch : CVS to Subversion Repository Converter
db4.i386 : The Berkeley DB database library (version 4) for C.
dbus-python.i386 : D-Bus Python Bindings
ddd.i386 : GUI for several command-line debuggers
deluge.i386 : Graphical BitTorrent client with support for DHT, UPnP, and
PEX
denyhosts.noarch : A script to help thwart ssh server attacks
epydoc.noarch : Edward Loper's Python API documentation generation tool
exaile.i386 : A music player
flumotion.i386 : Flumotion - the Fluendo Streaming Server
fuzzyclock.noarch : Generates fuzzy clock output
gamin-python.i386 : Python bindings for the gamin library
gdal.i386 : Geospatial Data Abstraction Library
gdal-python.i386 : Python modules for the GDAL file format library
getmail.noarch : POP3 mail retriever with reliable Maildir delivery
glade2.i386 : A GTK+ GUI builder.
gnome-menus.i386 : A menu system for the GNOME project
gnome-python2.i386 : The sources for the PyGNOME Python extension module
gnome-python2-applet.i386 : Python bindings for GNOME Panel applets.
gnome-python2-bonobo.i386 : Python bindings for interacting with bonobo.
gnome-python2-canvas.i386 : Python bindings for the GNOME Canvas.
gnome-python2-desktop.i386 : The sources for additional PyGNOME Python
extension
: modules for the GNOME desktop
gnome-python2-extras.i386 : The sources for additional. PyGNOME Python
extension
: modules.
gnome-python2-gconf.i386 : Python bindings for interacting with GConf
gnome-python2-gnomedesktop.i386 : Python bindings for interacting with
gnome-
: desktop
gnome-python2-gnomekeyring.i386 : Python bindings for interacting with
gnome-
: keyring
gnome-python2-gnomeprint.i386 : Python bindings for interacting with
: libgnomeprint
gnome-python2-gnomevfs.i386 : Python bindings for interacting with gnome-
vfs
gnome-python2-gtkhtml2.i386 : Python bindings for interacting with
gtkhtml2

python-twisted-names.i386 : A Twisted DNS implementation
python-twisted-web.i386 : Twisted web server, programmable in Python
python-twisted-web2.i386 : Twisted web server, programmable in Python
python-twisted-words.i386 : Twisted Words contains Instant Messaging
implementations
python-twitter.noarch : A python wrapper around the Twitter API
python-tz.noarch : World Timezone Definitions for Python
python-urlgrabber.noarch : High-level cross-protocol url-grabber
python-urljr.noarch : Common interface to urllib2 and curl for making
HTTP requests
python-urwid.noarch : Console UI Library for Python
python-urwid.i386 : Console UI Library for Python
python-utmp.i386 : Python module for working with utmp
python-vcpx.noarch : Version Control Patch eXchanger
python-virtinst.noarch : Python modules for starting Xen guest
installations
python-vorbis.i386 : Python bindings for libvorbis
python-webob.noarch : WSGI request and response object
python-which.noarch : Small which replacement that can be used as a
Python module
python-wifi.noarch : Python binding for the wireless (wifi) extensions
python-xattr.i386 : Extended attributes for python
python-xdg.noarch : Python library to access freedesktop.org standards
python-xlib.i386 : Complete X11R6 client-side implementation
python-xlrd.noarch : Library to extract data from Microsoft Excel (tm)
spreadsheet files
python-yadis.noarch : Relying party support for the Yadis service
discovery protocol
python-yaml.noarch : Python package implementing YAML parser and emitter
python-yenc.i386 : yEnc Module for Python
python-zope-interface.i386 : Zope 3 Interface Infrastructure
pytone.i386 : Music Jukebox with a Curses Based GUI
pytraffic.i386 : Rush Hour game
pytz.noarch : World Timezone Definitions for Python
pywebdav.noarch : WebDAV library
pyxattr.i386 : Extended attributes library wrapper for Python
pyxdg.noarch : Python library to access freedesktop.org standards
pyxf86config.i386 : Python wrappers for libxf86config
pyzor.noarch : Pyzor collaborative spam filtering system
rdiff-backup.i386 : Convenient and transparent local/remote incremental
mirror/backup
rhnlib.noarch : Python libraries for the RHN project
rhpl.i386 : Library of python code used by programs in Red Hat Linux
rhpxl.i386 : Python library for configuring and running X.
rpm-python.i386 : Python bindings for apps which will manipulate RPM
packages.
rrdtool-python.i386 : Python RRDtool bindings
sagator.noarch : SAGATOR - antivir/antispam gateway for smtp server
scapy.noarch : Interactive packet manipulation tool and network scanner
scipy.i386 : Scipy: Scientific Tools for Python
scons.noarch : An Open Source software construction tool
sip.i386 : SIP - Python/C++ Bindings Generator
sip-devel.i386 : Files needed to generate Python bindings for any C++
class library
solarwolf.noarch : Python SDL game where you have to collect energy cubes
spacepong.noarch : An innovative Python SDL game that is controlled with
the mouse
stgit.noarch : StGIT provides similar functionality to Quilt on top of
GIT
sulk.i386 : Sulk, the hackable Space Hulk
supybot.noarch : Cross-platform IRC bot written in Python
swig.i386 : Simplified Wrapper and Interface Generator
sympy.noarch : A Python library for symbolic mathematics
system-config-bind.noarch : The Red Hat BIND DNS Configuration Tool.
tkinter.i386 : A graphical user interface for the Python scripting
language.
trytond.noarch : Server for the Tryton application framework
txt2tags.noarch : Converts text files to HTML, XHTML, sgml, LaTeX, man...
wxPython.i386 : GUI toolkit for the Python programming language
wxPython-devel.i386 : Development files for wxPython add-on modules
yum-protect-packages.noarch : Yum plugin to prevents Yum from removing
itself and other protected packages
zope.i386 : Web application server for flexible content management
applications

--
Rahul
 
Reply With Quote
 
Robert Kern
Guest
Posts: n/a
 
      04-04-2009
On 2009-04-04 18:08, John Yeung wrote:
> I believe cProfile was added in 2.5. Your best bet on 2.4 is probably
> the profile module. That is what the docs recommend.


Oops, I missed that piece of information. Alternately, the OP can install
lsprof, which was cProfile's third-party incarnation before it got integrated
into the stdlib:

http://codespeak.net/svn/user/arigo/hack/misc/lsprof/

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

 
Reply With Quote
 
John Machin
Guest
Posts: n/a
 
      04-04-2009
On Apr 5, 8:46*am, Rahul <(E-Mail Removed)> wrote:
> I need to profile a slow-running code. The problem is I cannot seem to find *
> cProfile.py.
>
> Where can I get it? Is it not included in the normal distro? I tried
> googling it up and theres tons of info on how to use it but no links for
> where to download it from.
>
> I am using Python 2.4.4 (#3, Feb 17 2008, 15:06:10).


Read the fantastic manual:

http://docs.python.org/library/profile.html

Note: this is the *first* hit when you google either "cprofile" or
"cProfile.py".

"""
The Python standard library provides three different profilers:

1.

cProfile is recommended for most users; itís a C extension with
reasonable overhead that makes it suitable for profiling long-running
programs. Based on lsprof, contributed by Brett Rosen and Ted Czotter.

New in version 2.5.
"""
 
Reply With Quote
 
Rahul
Guest
Posts: n/a
 
      04-04-2009
John Yeung <(E-Mail Removed)> wrote in news:c0752f32-b0cf-4fde-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> I believe cProfile was added in 2.5. Your best bet on 2.4 is probably
> the profile module. That is what the docs recommend.
>


Thanks John. That works. I'll use "profile" instead.

--
Rahul
 
Reply With Quote
 
Rahul
Guest
Posts: n/a
 
      04-04-2009
John Machin <(E-Mail Removed)> wrote in news:0a8400dc-b14b-4bb9-a608-
(E-Mail Removed):

> Read the fantastic manual:
>
> http://docs.python.org/library/profile.html

[snip]
> cProfile is recommended for most users; it's a C extension with
> reasonable overhead that makes it suitable for profiling long-running
> programs. Based on lsprof, contributed by Brett Rosen and Ted Czotter.
>
> New in version 2.5.
>


Thanks John; I did read the manual which is why I decided to use cProfile
as it was "recommended for most users". I missed the last bit about "New
in version 2.5."

--
Rahul
 
Reply With Quote
 
John Machin
Guest
Posts: n/a
 
      04-04-2009
On Apr 5, 9:41*am, Rahul <(E-Mail Removed)> wrote:
> John Machin <(E-Mail Removed)> wrote in news:0a8400dc-b14b-4bb9-a608-
> (E-Mail Removed):
>
>
>
> > Read the fantastic manual:

>
> >http://docs.python.org/library/profile.html

> *[snip]
> > * * * cProfile is recommended for most users; it's a C extension with
> > reasonable overhead that makes it suitable for profiling long-running
> > programs. Based on lsprof, contributed by Brett Rosen and Ted Czotter.

>
> > * * * New in version 2.5.

>
> Thanks John; I did read the manual which is why I decided to use cProfile
> as it was "recommended for most users". *I missed the last bit about "New
> in version 2.5."


Looks like our definitions of "read" differ
 
Reply With Quote
 
Rahul
Guest
Posts: n/a
 
      04-05-2009
John Machin <(E-Mail Removed)> wrote in news:4c8ee09e-71e2-464a-a3c0-
(E-Mail Removed):

> Looks like our definitions of "read" differ
>


Sorry. I ought to have said "skimmed"

I guess I am one of those guilty lazy-bums that the manual refers to under
<<<users that ďdonít want to read the manual.Ē >>>

--
Rahul
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To be not, or not to be not? Ruby Freak Ruby 2 09-23-2008 08:04 AM
Why not 'foo = not f' instead of 'foo = (not f or 1) and 0'? Kristian Domke Python 11 01-23-2008 07:27 PM
'' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. rote ASP .Net 2 01-23-2008 03:07 PM
Cisco 3640 3620 3600 not detecting, not enabling, not working: NM-2FE2W Taki Soho Cisco 0 09-22-2004 07:28 AM
maintaining control with cookies (not strictly an ASP or even server side question. But not not either) Stephanie Stowe ASP General 2 04-07-2004 04:23 PM



Advertisments