首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在配置更新通知程序时,即使安装了chardet,也找不到chardet。

在配置更新通知程序时,即使安装了chardet,也找不到chardet。
EN

Ask Ubuntu用户
提问于 2019-06-05 10:03:29
回答 1查看 904关注 0票数 1

因此,我的ubuntu安装(16.04.6LTS)在配置更新通知程序时遇到了问题:

代码语言:javascript
复制
~$ 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 
    import debian.deb822
  File "/usr/lib/python3/dist-packages/debian/deb822.py", line 38, in 
    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来完成这个配置工作。试图安装它告诉我它已经安装了:

代码语言:javascript
复制
$ 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安装的:

代码语言:javascript
复制
$ 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.
EN

回答 1

Ask Ubuntu用户

发布于 2019-06-05 10:32:59

好吧,发现问题了。经过一番周旋之后,我发现我有两个不同版本的python3 (3.5和3.6),/usr/bin中的python3符号链接指向了错误的一个(3.5)。删除链接,重新生成指向3.6 -现在事情工作:

代码语言:javascript
复制
$ 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
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1148751

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档