Eu não posso fazer nada com o apt-get por causa do python-minimal
. Acho que posso ter corrompido meu python!
Sempre que eu quiser instalar, remover ou atualizar usando apt-get
, isso me dá este erro:
Errors were encountered while processing:
python-minimal
Eu tentei pesquisar e tentei todas as soluções que encontrei sobre esse problema. Agora, estou em um ponto em que quero desinstalar e instalar de forma limpa uma nova versão do python.
Estas são as coisas que eu tentei até agora:
Primeiro, eu tinha o python instalado, e todo comando apt-get
resultou nesse
saída:
todos esses comandos:
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
resultou nesta mesma saída:
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)
então eu tentei isso , this , isto , isto e isto e nada funcionou para mim.
então eu me cansei e tentei remover manualmente o python, então eu removi arquivos python com rm -rf
e agora este comando:
sudo apt-get upgrade python -f
resulta em:
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)
e agora, quando eu executo sudo apt-get purge python-minimal
, obtenho
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).
e depois de executar sudo apt-get -f install
, obtenho
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)
executando este comando sudo dpkg --configure -a
me dá a seguinte saída:
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