Ubuntu 18.04 python-tz 和 python-zmq 错误

Ubuntu 18.04 python-tz 和 python-zmq 错误

我安装了 Python 2.7.15rc1,当我将 python 符号链接临时更改为 Python3 并改回时,出现了一些问题。

现在,当我尝试通过 apt 进行更新时。

sudo apt update -y && sudo apt upgrade -y 

这就是我得到的。


The following additional packages will be installed:
  python-zmq
The following packages will be upgraded:
  python-tz python-zmq
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
94 not fully installed or removed.
Need to get 0 B/642 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 632636 files and directories currently installed.)
Preparing to unpack .../python-tz_2019.2-1ppa1~bionic_all.deb ...
/var/lib/dpkg/info/python-tz.prerm: 6: /var/lib/dpkg/info/python-tz.prerm: pyclean: not found
dpkg: warning: old python-tz package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-tz_2019.2-1ppa1~bionic_all.deb (--unpack):
 new python-tz package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python-tz.postinst: 6: /var/lib/dpkg/info/python-tz.postinst: pycompile: not found
dpkg: error while cleaning up:
 installed python-tz package post-installation script subprocess returned error exit status 127
Preparing to unpack .../python-zmq_18.1.0-1ppa1~bionic_amd64.deb ...
/var/lib/dpkg/info/python-zmq.prerm: 6: /var/lib/dpkg/info/python-zmq.prerm: pyclean: not found
dpkg: warning: old python-zmq package pre-removal script subprocess returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-zmq_18.1.0-1ppa1~bionic_amd64.deb (--unpack):
 new python-zmq package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python-zmq.postinst: 6: /var/lib/dpkg/info/python-zmq.postinst: pycompile: not found
dpkg: error while cleaning up:
 installed python-zmq package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/python-tz_2019.2-1ppa1~bionic_all.deb
 /var/cache/apt/archives/python-zmq_18.1.0-1ppa1~bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

您的输出显示此错误:

pycompile:未找到

pycompile由提供Python 语言的最小子集(版本 2.7)或者python-minimal更准确地说libpython2.7-minimal

请阅读这里


要修复此问题,您需要重新安装libpython2.7-minimalpython-minimal在终端中运行以下命令:

sudo apt install --reinstall libpython2.7-minimal

或者:

sudo apt install --reinstall python-minimal

相关内容