Менеджер обновлений не работает “ImportError: Никакой модуль, названный 'кодеки”

Каждый раз, когда я пробую sudo update-manager это возвращается:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
  File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'

Я попробовал следующие команды:

sudo apt-get update # no errors
sudo apt-get clean # no errors
sudo apt-get install -fy # same error
sudo apt-get install --reinstall python3 # same error
sudo apt-get install --reinstall dpkg apt update-manager python # same error
sudo apt-get autoremove # same error
sudo apt-get upgrade # same error
sudo apt-get install --reinstall python3.4 #E: Internal Error, No file name for python3.4:amd64
sudo apt-get install python3.4 # same error (Dependency problems )
python --version #Python 2.7.6
sudo apt-get -f install # same error (Dependency problems )

Я не изменил __ init __.py файл.

Вот полная ошибка:

$ sudo apt-get -f install
[sudo] password for user: 
Building dependency tree                  
Reading state information... 
After this operation, 0 B of additional disk space will be used.
Setting up python3.4 (3.4.0-2ubuntu1) ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
  File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'
Aborted (core dumped)
dpkg: error processing package python3.4 (--configure):
 subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of python3:
 python3 depends on python3.4 (>= 3.4.0-0~); however:
  Package python3.4 is not configured yet.

dpkg: error processing package python3 (--configure):
 dependency problems - leaving unconfigured
Setting up screen-resolution-extra (0.17.1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
  File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'
Aborted (core dumped)
dpkg: error processing package screen-resolution-extra (--configure):
 subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of update-manager:
 update-manager depends on python3; however:
  Package python3 is not configured yet.
 update-manager depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package update-manager (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python3.4
 python3
 screen-resolution-extra
 update-manager
E: Sub-process /usr/bin/dpkg returned an error code (1)

Я использую Ubuntu 14.04 LTS.

2
задан 16 November 2019 в 17:49

1 ответ

Это может произойти, если Ваша файловая система была повреждена. Проверьте журналы на подсказки, и также посмотрите в /lost+found. Решение состоит в том, чтобы переустановить пакет, содержащий недостающий модуль.

Находят пакет Ubuntu, обеспечивающий этот файл:

dpkg -S /usr/lib/python3.4/codecs.py

Переустанавливают пакет:

sudo apt-get install --reinstall libpython3.4-minimal

кроме того, переустановите пакеты, которые обеспечивают любые другие файлы, найденные в lost+found

1
ответ дан 2 December 2019 в 05:10

Другие вопросы по тегам:

Похожие вопросы: