Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ubuntu 11.10 separated out python-profiler from the Python standard library due to licensing philosophies. (According to what I could Google, correct me if I'm wrong.)

This is an active bug since October for 11.10. I have Python 2.7.2 installed, so the dependency errors are wrong. 'apt-get check' does not resolve the problem.

What is the best way to resolve to this? Thank you.

sudo apt-get install python-profiler   

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-profiler : Depends: python (>= 2.5) but it is not going to be installed
                   Depends: python (< 2.8) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
share|improve this question
    
Note: Made a fresh install on a new system and python-profile appears to be present. –  Hemm Mar 25 '12 at 12:18
add comment

1 Answer 1

up vote 6 down vote accepted

The python-profile package just includes a few .py files:

$ apt-file list python-profiler
python-profiler: /usr/lib/python2.5/profile.py
python-profiler: /usr/lib/python2.5/pstats.py
python-profiler: /usr/lib/python2.6/profile.py
python-profiler: /usr/lib/python2.6/pstats.py
python-profiler: /usr/lib/python2.7/profile.py
python-profiler: /usr/lib/python2.7/pstats.py
python-profiler: /usr/share/doc/python-profiler/README.Debian
python-profiler: /usr/share/doc/python-profiler/changelog.Debian.gz
python-profiler: /usr/share/doc/python-profiler/copyright
python-profiler: /usr/share/lintian/overrides/python-profiler

Hence, you can download the binary package using apt-get download python-profiler and extract its contents with dpkg -x python-profiler_<version>_all.deb <dir>. Once you have the contents of the package, you can just copy the .py files to their location to make the profiler modules available in your python installation.

share|improve this answer
1  
+1 Definitely a better idea than potentially breaking apt just for the sake of a few .py sources :) –  Caesium Nov 22 '11 at 10:00
1  
One more thing, since you're probably going to copy the .py files to a directory with root permissions, then it's a good idea to byte compile those files using python -m compileall <dir>. –  jcollado Nov 22 '11 at 12:28
    
Caesium, I was looking for a solution that was neutral (ie not breaking anything, or creating a new problem when the bug is fixed), but this looks like the best way to me too. Thanks –  Hemm Nov 22 '11 at 23:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.