修复损坏的Python3.2安装(Ubuntu)

2024-05-16 10:58:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我愚蠢地从/usr/lib/python3.2中删除subprocess.py模块
所以我试图通过执行以下命令来解决这个问题:

sudo apt-get install python3

但我刚刚犯了个错误:

Traceback (most recent call last): File "/usr/bin/py3compile", line 33, in
from subprocess import PIPE, Popen ImportError: No module named subprocess dpkg: error processing python3 (--configure): subprocess
installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3-gobject: python3-gobject depends on python3 (>= 3.2); however: Package python3 is not configured yet. python3-gobject depends on python3 (<< 3.3); however: Package python3 is not configured yet. dpkg: error processing python3-gobject (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: python3 python3-gobject E: Sub-process /usr/bin/dpkg returned an error code (1)

那我该怎么解决呢?


Tags: nofrombinconfigureusrerrordependencypython3
1条回答
网友
1楼 · 发布于 2024-05-16 10:58:11

你试过卸载Python3然后重新安装吗?

sudo apt-get remove python3
sudo apt-get install python3

或者也许

sudo apt-get --reinstall install python3

如果这不起作用,只需从python存储库中获取subprocess.py并将其复制到正确的目录。例如,对于Python 3.2.2,使用浏览器导航到:

http://hg.python.org/cpython/file/137e45f15c0b/Lib/subprocess.py

点击“raw”(左栏)下载文件。

对于其他版本,请转到:

http://hg.python.org/cpython/tags

选择您的版本,然后单击browse(左列),然后单击Lib(从文件夹列表),然后单击subprocess.py,最后单击raw(左列)下载文件。

相关问题 更多 >