Excluído acidentalmente /usr/lib/python3.4

4

Eu estou no Ubuntu 14.04 e acidentalmente apaguei o python3.4

Estou tentando

apt-get install python3.4
dpkg-reconfigure -a
apt-get install -f

Mas estou vendo os seguintes erros

dpkg: error processing package dh-python (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.4-minimal
 python3-minimal
 python3.4
 python3
 python3-pkg-resources
 python-chardet-whl
 python-pip-whl
 python3-chardet
 python3-colorama
 python3.4-dev
 python3-dev
 python3-distlib
 python3-six
 python3-html5lib
 python3-urllib3
 python3-requests
 python3-setuptools
 python3-pip
 python3-wheel
 dh-python
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu também tentei remover completamente o python3.4 usando

apt-get remove --purge python3.4

e reinstalar. mas isso me dá os seguintes erros

Rebuilding /usr/share/applications/bamf-2.index...
Setting up python3.4-minimal (3.4.3-1ubuntu1~14.04.3) ...
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted
dpkg: error processing package python3.4-minimal (--configure):
 subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of python3.4:
 python3.4 depends on python3.4-minimal (= 3.4.3-1ubuntu1~14.04.3); however:
  Package python3.4-minimal is not configured yet.

dpkg: error processing package python3.4 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.4-minimal
 python3.4
E: Sub-process /usr/bin/dpkg returned an error code (1)

Alguém pode me ajudar com isso?

saída para a resposta da @Nodak:

Rebuilding /usr/share/applications/bamf-2.index...
Setting up python3.4-minimal (3.4.3-1ubuntu1~14.04.3) ...
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted
dpkg: error processing package python3.4-minimal (--configure):
 subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of python3.4:
 python3.4 depends on python3.4-minimal (= 3.4.3-1ubuntu1~14.04.3); however:
  Package python3.4-minimal is not configured yet.

dpkg: error processing package python3.4 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.4-minimal (>= 3.4.0-0~); however:
  Package python3.4-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3:
 python3 depends on python3.4 (>= 3.4.0-0~); however:
  Package python3.4 is not configured yet.
 python3 depends on python3-minimal (= 3.4.0-0ubuntu2); however:
  Package python3-minimal is not configured yet.

dpkg: error processing package python3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dh-python:
 dh-python depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package dh-python (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.4-minimal
 python3.4
 python3-minimal
 python3
 dh-python
E: Sub-process /usr/bin/dpkg returned an error code (1)

Esta é a saída quando eu corro dpkg-reconfigure -a

dpkg-reconfigure -a
acpid stop/waiting
acpid start/running, process 26874
avahi-daemon stop/waiting
avahi-daemon start/running, process 27149
Rebuilding /usr/share/applications/bamf-2.index...
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
update-initramfs: deferring update (trigger activated)
cgroup-lite stop/waiting
cgroup-lite start/running
/var/lib/dpkg/info/compiz.config: 1: /var/lib/dpkg/info/compiz.config: [general]: not found
/var/lib/dpkg/info/compiz.config: 2: /var/lib/dpkg/info/compiz.config: backend: not found
/var/lib/dpkg/info/compiz.config: 3: /var/lib/dpkg/info/compiz.config: plugin_list_autosort: not found
/var/lib/dpkg/info/compiz.config: 5: /var/lib/dpkg/info/compiz.config: [gnome_session]: not found
/var/lib/dpkg/info/compiz.config: 6: /var/lib/dpkg/info/compiz.config: backend: not found
/var/lib/dpkg/info/compiz.config: 7: /var/lib/dpkg/info/compiz.config: integration: not found
/var/lib/dpkg/info/compiz.config: 8: /var/lib/dpkg/info/compiz.config: plugin_list_autosort: not found
/var/lib/dpkg/info/compiz.config: 9: /var/lib/dpkg/info/compiz.config: profile: not found
/var/lib/dpkg/info/compiz.config: 11: /var/lib/dpkg/info/compiz.config: [general_ubuntu]: not found
/var/lib/dpkg/info/compiz.config: 12: /var/lib/dpkg/info/compiz.config: backend: not found
/var/lib/dpkg/info/compiz.config: 13: /var/lib/dpkg/info/compiz.config: integration: not found
/var/lib/dpkg/info/compiz.config: 14: /var/lib/dpkg/info/compiz.config: plugin_list_autosort: not found
/var/lib/dpkg/info/compiz.config: 15: /var/lib/dpkg/info/compiz.config: profile: not found
    
por Kiran Vemuri 19.12.2015 / 05:06

2 respostas

0

Tente desinstalar completamente o python executando

sudo apt-get remove --purge python3.4

Isso removerá todas as dependências instaladas com o python

Em seguida, instale o python novamente executando

sudo apt-get install python3.4

Espero que isso tenha ajudado,

Zimbinskers

Portanto, tente instalar apenas o python e não a versão específica 3.4. Pode haver um problema com dependências que não estão sendo instaladas corretamente. Então apenas corra

sudo apt-get install python

E me diga os resultados.

Espero que isso ajude,

Zimbinskers

    
por user483937 19.12.2015 / 05:12
0

É um mistério.
Eu deletei /usr/lib/python3.4 , então eu sudo apt-get purge -f python3

(se você tentar isso, você pode querer uma lista de seus pacotes para reinstalar os pacotes que são dependentes do Python3 e, posteriormente, removidos pelo apt-get magic.

Instruções sobre como fazer isso

Depois fui reinstalar o python3 sudo apt-get install -f python3 . Falhou.

sudo apt-get -f install foi emitido e vários pacotes foram instalados.

A reemissão de sudo apt-get install -f python3 foi bem-sucedida na restauração do diretório usr/lib/python3.4 e da funcionalidade do Python 3.

Eu reinstalei os pacotes perdidos como danos colaterais.

    
por Nodak 21.12.2015 / 05:21