
私はapt-getでは何もできません。なぜならpython-minimal
…私のPythonが破損している可能性があるからです!
インストール、アンインストール、またはアップグレードを使用するたびに、apt-get
次のエラーが発生します。
Errors were encountered while processing:
python-minimal
検索を試み、この問題について見つけたすべてのソリューションを試してみましたが、Pythonの新しいバージョンを完全に削除してインストールしようとしています。
これまで私は次のことを試しました:
まず、Pythonをインストールし、すべてのapt-get
コマンドは次の出力を生成します。
これらのコマンドはすべて次のとおりです。
sudo apt-get autoremove -f
sudo apt-get autoclean # and then install python
sudo apt-get upgrade
sudo apt-get -f install
sudo apt-get download python-minimal; sudo dpkg -i py*deb
sudo apt-get remove python
sudo apt-get autoremove python-minimal
sudo apt-get install --reinstall python-minimal
同じ出力を生成します。
Setting up python-minimal (2.7.14-1~14.04.york0) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 162, in
_run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/compileall.py", line 16, in <module>
import struct
File "/usr/local/lib/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: No module named _struct
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit
status 1
Errors were encountered while processing:
python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
それから試しました。これ、これ、これ、これそしてこれ私には何も効果がありません。
その後、うんざりしてPythonを手動で削除しようとしたので、次のようにrm -rf
Pythonファイルを削除しました。
sudo apt-get upgrade python -f
結果:
Setting up python-minimal (2.7.14-1~14.04.york0) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit
status 1
Errors were encountered while processing:
python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
今私が走るとsudo apt-get purge python-minimal
私は得ます。
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python : Depends: python-minimal (= 2.7.5-5ubuntu3) but it is not
going to be installed
python-support : Depends: python-minimal but it is not going to be
installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or
specify a solution).
走ったらsudo apt-get -f install
私は得ます。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libpython-stdlib python
Suggested packages:
python-doc python-tk
The following packages will be upgraded:
libpython-stdlib python
2 upgraded, 0 newly installed, 0 to remove and 253 not upgraded.
1 not fully installed or removed.
Need to get 0 B/175 kB of archives.
After this operation, 4,096 B disk space will be freed.
Do you want to continue? [Y/n] Y
Setting up python-minimal (2.7.14-1~14.04.york0) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
編集する:
このコマンドを実行すると、sudo dpkg --configure -a
次の出力が提供されます。
Setting up python-minimal (2.7.14-1~14.04.york0) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit
status 1
Errors were encountered while processing:
python-minimal