卸载功能失调的 Python 模块

卸载功能失调的 Python 模块

functools我已经通过安装了 python 模块easy_install,现在无法卸载它。

当我像这样运行python时

python -c 'import functools'

我收到这个错误

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/functools.py", line 72, in <module>
    root = max(roots)       # prefer __lt__ to __le__ to __gt__ to __ge__
AttributeError: 'module' object has no attribute 'compose'

我无法通过 pip 卸载它

~$ sudo pip uninstall functools
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 26, in <module>
    import functools
  File "build/bdist.linux-x86_64/egg/functools.py", line 72, in <module>
    root = max(roots)       # prefer __lt__ to __le__ to __gt__ to __ge__
AttributeError: 'module' object has no attribute 'compose'

我现在无法运行像 Terminator 这样的程序

$ terminator
Traceback (most recent call last):
  File "/usr/bin/terminator", line 33, in <module>
    import gtk, pango, gobject
  File "/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py", line 30, in <module>
    import gobject as _gobject
  File "/usr/lib/python2.7/dist-packages/gobject/__init__.py", line 26, in <module>
    from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
  File "/usr/lib/python2.7/dist-packages/glib/option.py", line 33, in <module>
    import optparse
  File "/usr/lib/python2.7/optparse.py", line 90, in <module>
    from gettext import gettext
  File "/usr/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "/usr/lib/python2.7/locale.py", line 19, in <module>
    import functools
  File "build/bdist.linux-x86_64/egg/functools.py", line 72, in <module>
    root = max(roots)       # prefer __lt__ to __le__ to __gt__ to __ge__
AttributeError: 'module' object has no attribute 'compose'

我该怎么做才能卸载该functools模块?

相关内容