При настройке update-notifier - не могу найти chardet, даже если он установлен

Таким образом, в моей установке Ubuntu (16.04.6 LTS) возникла проблема с настройкой уведомлений об обновлениях:

~$ sudo dpkg --configure -a
Setting up update-notifier-common (3.168.10) ...
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 24, in <module>
    import debian.deb822
  File "/usr/lib/python3/dist-packages/debian/deb822.py", line 38, in <module>
    import chardet
ImportError: No module named 'chardet'
dpkg: error processing package update-notifier-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-notifier-common (= 3.168.10); however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on update-notifier; however:
  Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 update-notifier-common
 update-notifier
 ubuntu-desktop

Итак, похоже, мне нужен chadet для работы этой конфигурации. Попытка установить это говорит мне, что он уже установлен:

$ sudo apt-get install python-chardet
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-chardet is already the newest version (2.3.0-2).
0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

Не уверен, почему python (v.2.7.12) не может найти chardet, есть идеи?

Говорит, что он установлен для Python 3, а также:

$ sudo apt install python3-chardet
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-chardet is already the newest version (2.3.0-2).
0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
1
задан 5 June 2019 в 13:08

1 ответ

Хорошо, проблема найдена. Немного покопавшись, я обнаружил, что у меня есть две разные версии python3 (3.5 и 3.6), и символическая ссылка python3 в / usr / bin указывала на неправильную (3.5). Удалил ссылку, заново сгенерировал, чтобы указать на 3,6 - теперь все работает:

$ sudo dpkg --configure -a
Setting up update-notifier-common (3.168.10) ...
Setting up update-notifier (3.168.10) ...
Setting up ubuntu-desktop (1.361.3) ...

Так что, по сути, мой плохой от предыдущего перебора моей системы.

1
ответ дан 5 June 2019 в 13:08

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

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