Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Profiling with Debian GNU/Linux

Python packages in Debian do not include the profile or pstats modules by default. If you've tried to use CherryPy on Debian you might have noticed this. These modules have licenses which land them in Debian's "non-free" category; to install them, you must obtain them in a separate step from the main Python package.

The profile module is available as a separate package called python2.4-profiler (or python2.3-profiler, etc.) that is available in non-free. To get at it just make sure that you mention non-free in /etc/apt/sources.list.

For example:

    deb http://ftp.fi.debian.org/debian/ unstable main contrib non-free
    deb-src http://ftp.fi.debian.org/debian/ unstable main contrib non-free

Another example:

    deb http://ftp.fi.debian.org/debian/ stable main non-free
    deb-src http://ftp.fi.debian.org/debian/ stable main non-free

(Note: If you didn't already have non-free in sources.list remember to run apt-get update.)

All that is left is installing the profiler package. Just run apt-get install python2.4-profiler.

That's it.

-Ari Turpeinen

Ubuntu

To get the package in ubuntu, you only have to add multiverse to your preferred source. This way you're using the official ubuntu package, instead of the one from the debian repositories. It's originally like this:

deb http://us.archive.ubuntu.com/ubuntu/ edgy main restricted

and has to be updated to:

deb http://us.archive.ubuntu.com/ubuntu/ edgy main restricted multiverse

In addition, the package is just "python-profiler" (python2.4-profiler has no installation candidate):

sudo apt-get install python-profiler

-Sheco

Hosted by WebFaction

Log in as guest/cpguest to create tickets