修复损坏的Python3

修复损坏的Python3

本文介绍了修复损坏的Python3.2安装(Ubuntu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愚蠢地从/usr/lib/python3.2中删除subprocess.py模块.因此,我尝试通过执行以下操作来解决此问题:

I stupidly remove the subprocess.py module from /usr/lib/python3.2
so I try to fix this with executing:

但是我刚遇到这个错误:

but I just got this error:

那我该如何解决呢?

推荐答案

您是否尝试过卸载Python 3,然后再次安装?

Have you tried uninstalling Python 3 and then installing it again?

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

或者也许

sudo apt-get --reinstall install python3

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

If this does not work, just grab subprocess.py from the python repository and copy it to the right directory. For example, for Python 3.2.2, navigate with your browser to:

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

,然后单击原始"(左列)以下载文件.

and the click in "raw" (left column) to download the file.

对于其他版本,只需转到:

For other versions, just go to:

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

选择您的版本,然后单击浏览(左列),然后单击Lib(从文件夹列表中),然后依次单击"subprocess.py"和原始"(左列)以下载文件.

Pick your version, then click on browse (left column), then Lib (from the folders list), then "subprocess.py" and then "raw" (left column) to download the file.

这篇关于修复损坏的Python3.2安装(Ubuntu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:15