나는 apt-get으로 아무것도 할 수 없습니다. 왜냐하면 python-minimal
... 내 파이썬이 손상되었을 수도 있기 때문입니다!
설치, 제거 또는 업그레이드를 사용할 때마다 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