我删除了一些“错误”的 mimetypes 文件。我该如何解决此错误?重新安装 electrum 和 pip 也无法解决这个问题。
$ electrum
Error: No module named mimetypes. Try 'sudo pip install <module-name>'
$ sudo pip install mimetypes
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point(pip==1.5.6', console_scripts', pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py, line 5, in <module>
import mimetypes
ImportError: No module named mimetypes
答案1
问题解决了!我从 github 中获取了缺失的 mimetypes.py,之后(可能没有必要)执行了 sudo apt-get install --reinstall python2.7