
Ubuntu 11.10 отделил python-profiler от стандартной библиотеки Python из-за философии лицензирования. (Согласно тому, что я смог найти в Google, поправьте меня, если я ошибаюсь.)
Это активная ошибка с октября для 11.10. У меня установлен Python 2.7.2, поэтому ошибки зависимостей неверны. 'apt-get check' не решает проблему.
Как лучше всего решить эту проблему? Спасибо.
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.
решение1
В python-profile
пакет входит всего несколько .py
файлов:
$ 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
Следовательно, вы можете загрузить бинарный пакет с помощью apt-get download python-profiler
и извлечь его содержимое с помощью dpkg -x python-profiler_<version>_all.deb <dir>
. Получив содержимое пакета, вы можете просто скопировать файлы .py
в их местоположение, чтобы сделать модули профилировщика доступными в вашей установке Python.