
由於許可理念,Ubuntu 11.10 將 python-profiler 從 Python 標準庫中分離出來。 (根據我谷歌的內容,如果我錯了,請糾正我。)
這是自 10 月 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 安裝中可用。