Python Profiler on Ubuntu Missing or import hotshots.stats fail

Turns out Ubuntu is missing pythons standard library component profile.py due to licensing issues related to debian.

I don’t really care about that.

What I care about is the solution.

Enable the multiverse repository in your ubuntu.

vim /etc/apt/sources.list

Copy and paste one of the lines (they are version specific) and replace the ending text with “multiverse”. It doesn’t really do any damage to keep other repo names on there.

## Added mutliverse for python-profiler
deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse

Update repo list and install python-profiler.

apt-get update
apt-get install python-profiler

Done.

Leave a Comment