安装Python时遇到如下问题,解决方案

~$ sudo apt-get install python-pip
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python-pip 已经是最新的版本了。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 233 个软件包未被升级。
有 8 个软件包没有被完全安装或卸载。
解压缩后会消耗掉 0 B 的额外空间。
您希望继续执行吗? [Y/n] Y
正在设置 mercurial-common (2.8.2-1ubuntu1.3) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
dpkg: 处理软件包 mercurial-common (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
dpkg: 依赖关系问题使得 mercurial 的配置工作不能继续:
 mercurial 依赖于 mercurial-common (= 2.8.2-1ubuntu1.3);然而:
  软件包 mercurial-common 尚未配置。

dpkg: 处理软件包 mercurial (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在设置 python-colorama (0.2.5-0.1ubuntu2) ...
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
dpkg: 处理软件包 python-colorama (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
正在设置 python-distlib (0.1.8-1ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    dpkg: 处理软件包 python-distlib (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
正在设置 python-html5lib (0.999-3~ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
dpkg: 处理软件包 python-html5lib (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    正在设置 python-setuptools (3.3-1ubuntu2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    由于已经达到 MaxReports 限制,没有写入 apport 报告。
                        dpkg: 处理软件包 python-setuptools (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
dpkg: 依赖关系问题使得 python-pip 的配置工作不能继续:
 python-pip 依赖于 python-colorama;然而:
  软件包 python-colorama 尚未配置。
 python-pip 依赖于 python-distlib;然而:
  软件包 python-distlib 尚未配置。
 python-pip 依赖于 python-html5lib;然而:
  软件包 python-html5lib 尚未配置。
 python-pip 依赖于 python-setuptools (>= 0.6c1);然而:
  软件包 python-setuptools 尚未配置。

dpkg: 处理软件包 python-pip (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在设置 python-wheel (0.24.0-1~ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 38, in <module>
    from debpython.namespace import add_namespace_files
ImportError: No module named ‘debpython.namespace‘
dpkg: 处理软件包 python-wheel (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 1
由于已经达到 MaxReports 限制,没有写入 apport 报告。
                                                    E: Sub-process /usr/bin/dpkg returned an error code (1)

首先输入:

 sudo dpkg -C 

显示:

:~$ sudo dpkg -C
下列软件包已被解开,但是尚未配置。
要令它们运行正常,您必须借助 dpkg --configure
或者 dselect 菜单中的配置项:
 python-pip           alternative Python package installer
 mercurial            easy-to-use, scalable distributed version control system

下列软件包只是被不全面地配置了,这也许要归咎于
第一次配置它们时出的问题。您最好能重新配置它们。
借助 dpkg --configure <软件包名> 或者用 dselect
菜单中的配置项重新配置软件包:
 python-distlib       low-level components of python distutils2/packaging
 mercurial-common     easy-to-use, scalable distributed version control system
 python-colorama      Cross-platform colored terminal text in Python - Python 2
 python-html5lib      HTML parser/tokenizer based on the WHATWG HTML5 specifica
 python-setuptools    Python Distutils Enhancements
 python-wheel         built-package format for Python

分析:

原因是,我们在将python2.7升级到python3.3时,只是将/usr/local/bin目录下修改了(使用ln -s 或者其他),然而我们的配置目录并没有修改..

使用如下的方式可以有效的解决:

sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall python-minimal python-lockfile

参考链接:http://askubuntu.com/questions/534040/problem-installing-any-new-packages-in-ubuntu-because-of-python

时间: 2024-08-07 00:08:37

安装Python时遇到如下问题,解决方案的相关文章

安装 PostgreSQL 时丢失 libintl-8.dll 解决方案

发表于 2013 年 11 月 13 日     修订于 2018 年 05 月 05 日 PostgreSQL 比 MySQL 有更多的高级特性,而且微信支付的数据库也是基于 PostgreSQL,因此越来越多的开发者开始尝鲜 PostgreSQL,但毕竟是第一次安装,肯定会有学习成本.本文将帮你顺利渡过第一个“坑”——丢失 libintl-8.dll. 开发环境 操作系统:中文版 Windows7 x64 SP1 旗舰版数据库 PostgreSQL:postgresql-9.3.1-1-wi

安装LoadRunner时提示缺少vc2005_sp1_with_atl_fix_redist解决方案

原文:http://blog.csdn.net/xifeijian/article/details/8578832 我的电脑在安装UFT时,被要求需要卸载本机上安装的LoadRunner11,当LoadRunner11被卸载后,进行重新安装LoadRunner11时,会报缺少vc2005_sp1_with_atl_fix_redist错误,类似下图所示: 由提示信息可知,这里是由于本机缺少该组件所致,解决方案就是安装此组件,可以去网上下载,当然,我们完全没有必要这样做,因为在LoadRunner

apt-get install安装软件时出现依赖错误解决方案

在使用apt-get install安装软件时,经常会遇到如上图所示错误,该错误的意思为缺少依赖软件,解决方案为: aptitude install golang-go 版权声明:本文为博主原创文章,未经博主允许不得转载.

在centos7中安装python时,输入yum出现 -bash: /usr/bin/yum: No such file or directory

第一次真正认真的玩起linux,装了一个虚拟机,一看python版本是2.7的,想弄个3.7的,于是,百度上找到了这篇文章https://www.cnblogs.com/JahanGu/p/7452527.html . 结果执行到这一步"mv python python.bak"的时候悲剧了,因为我的电脑没有安装wget,这步命令让我的python变成了python.bak,而yum好像是基于python的,所以即便是执行yum -y install wget也没有用了,会出现-bas

安装Python时遇到的问题

configure: error: no acceptable C compiler found in $PATH 因为是linux,默认可以采用yum方式安装,则采用如下命令安装gcc编译器即可:# yum -y install gcc

openwrt挂载U盘和安装python

最近在openwrt上安装python时,老出现/overlay空间不足的错误,如下图所示: 不过用命令查看时,其空间确实挺小的: 看了这篇文章之后,想到了用闪存卡来扩容.由于我的系统内部已经有了相关usb驱动模块,所以一插上闪存卡就能识别了 基本想法很简单,先格式化,再挂载,再配置opkg.conf使软件安装到其上. 格式化 挂载到/mnt/usb目录 修改/etc/profile及/etc/opkg.conf文件 接下来安装软件时就好说了,先opkg update:然后opkg -d usb

在安装Python时报错

首先下载tar包 地址  http://www.python.org/ftp/python 下载好之后 解压  tar xjvf 在安装python时下载好tar包 在./configure时  报错提示  configure: error: no acceptable C compiler found in $PATH 查资料得知是缺少gcc组件 安装gcc组件即可 再次进行./configure  不再报错 make&&make install 编译完之后 mv /usr/bin/py

Python 2.7安装setuptools时的UnicodeDecodeError解决办法

我猜~~~很多一开始学习python的同学们一定也遇到了这个问题,在安装setuptools时候会遇到UnicodeDecodeError的错误. 我学的是3.x,但是周围的人都说2.7好,╮(╯▽╰)╭一开始我也不在乎,但是工作需要使用mongodb,但是它的包暂时只有2.7,我点点点点. 无奈我也就换了版本,改为2.7,但是问题来了,当我想安装setuptools的时候,恶心的错误来了.真的不知道安装这种成熟的工具还有这种问题. 在经过各种谷哥.度娘之后,有的说在代码中制定编码,试了不行,有

安装scipy时出现ERROR: Command errored out with exit status 1:的解决方案 &#458738;

原文: http://blog.gqylpy.com/gqy/417 置顶:来自一名75后老程序员的武林秘籍--必读(博主推荐) 来,先呈上武林秘籍链接:http://blog.gqylpy.com/gqy/401/ 你好,我是一名极客!一个 75 后的老工程师! 我将花两分钟,表述清楚我让你读这段文字的目的! 如果你看过武侠小说,你可以把这个经历理解为,你失足落入一个山洞遇到了一位垂暮的老者!而这位老者打算传你一套武功秘籍! 没错,我就是这个老者! 干研发 20 多年了!我也年轻过,奋斗过!我