【问题标题】:Error in installing/upgrading to python 3.4.3安装/升级到 python 3.4.3 时出错
【发布时间】:2015-03-01 11:02:28
【问题描述】:

我试图从 python 3.2 安装/升级到 3.4.3,但是很多事情都出错了。现在,即使我

apt-get install python3

我得到错误。这是终端输出

Setting up python-requests (0.8.2-1) ...
/var/lib/dpkg/info/python-requests.postinst: 6: /var/lib/dpkg/info/python-requests.postinst: pycompile: not found
dpkg: error processing python-requests (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-gevent (0.13.6-1ubuntu1) ...
/var/lib/dpkg/info/python-gevent.postinst: 6: /var/lib/dpkg/info/python-gevent.postinst: pycompile: not found
dpkg: error processing python-gevent (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up python-qrencode (1.01-2build1) ...
/var/lib/dpkg/info/python-qrencode.postinst: 5: /var/lib/dpkg/info/python-qrencode.postinst: update-python-modules: not found
dpkg: error processing python-qrencode (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 python-requests
 python-gevent
 python-qrencode
E: Sub-process /usr/bin/dpkg returned an error code (1)

请帮我解决这个问题。

【问题讨论】:

  • 尝试sudo apt-get remove --purge python3 && sudo apt-get update && sudo apt-get install python3 以(可能)回到“干净”状态。检查python3 --version,你可能很幸运得到了python 3.4!

标签: linux ubuntu python-3.x terminal upgrade


【解决方案1】:

我不小心删除了/usr/bin/ 中的python3.6。当我重新安装它时,我收到了类似的错误消息。

然后我尝试了以下命令并安装了python3.6

sudo apt-get remove --purge python3.6
sudo apt-get install -f --reinstall python3.6-minimal

我也试过sudo apt-get install -f --reinstall python-minimal,但没用。

希望我的经验对处于类似情况的人有所帮助。

【讨论】:

    【解决方案2】:

    尝试sudo apt-get remove --purge python3 && sudo apt-get update && sudo apt-get install python3 以(可能)回到“干净”状态。之后检查python3 --version,你可能会幸运地得到python 3.4!

    【讨论】:

    • @Th'Ink-King 你能解释一下最初出了什么问题吗?
    • 我不确定。我想知道它是否在更改路径时发生。从现在开始,我使用 python 的应用程序甚至无法加载。
    • @Th'Ink-King python3 --versionwhich python3which python 说什么?另外,您运行的是哪个版本的 Ubuntu?检查this question 以获得可能的有用信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-18
    • 2017-10-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多