
Ubuntu 11.10 では、ライセンスの考え方により、python-profiler が Python 標準ライブラリから分離されました。(Google で調べた限りでは、間違っていたら訂正してください。)
これは 11.10 で 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 インストールで使用できるようになります。