安装/升级到python 3.4.3时出错

时间:2015-03-01 11:02:29

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

我试图从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)

请帮我解决这个问题。

2 个答案:

答案 0 :(得分:0)

尝试sudo apt-get remove --purge python3 && sudo apt-get update && sudo apt-get install python3(可能)回到'清洁'州。之后检查python3 --version,你可能会很幸运并得到python 3.4!

答案 1 :(得分:0)

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

然后我尝试了以下命令并安装了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,但它没有用。

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