【问题标题】:Repair damaged Python3.2 installation (Ubuntu)修复损坏的Python3.2安装(Ubuntu)
【发布时间】:2012-03-15 20:30:09
【问题描述】:

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

sudo apt-get install python3  

但是我收到了这个错误:

Traceback (most recent call last):
File "/usr/bin/py3compile", line 33, in <module>  
    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)

我该如何解决这个问题?

【问题讨论】:

    标签: python apt-get


    【解决方案1】:

    您是否尝试过卸载 Python 3 然后重新安装?

    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

    选择您的版本,然后点击浏览(左栏)、Lib(从文件夹列表中)、“subprocess.py”和“raw”(左栏)下载文件。

    【讨论】:

    • 我试过了,但是不行。控制台显示相同的错误
    • 非常感谢,当我将原始文件复制到它所属的位置时,问题解决了。
    • 在同样的问题上花了两天时间,终于sudo apt-get --reinstall install python3解决了问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-03
    • 2018-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多