启动python解释器时的AttributeError

时间:2017-11-30 06:30:23

标签: python

python解释器抛出以下错误并在启动时退出。

:~$ python
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 400, in <module>
    import UserDict
  File "/usr/lib/python2.7/UserDict.py", line 116, in <module>
    import _abcoll
  File "/usr/lib/python2.7/_abcoll.py", line 11, in <module>
    from abc import ABCMeta, abstractmethod
  File "abc.py", line 2, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/collections.py", line 18, in <module>
    __all__ += _abcoll.__all__
AttributeError: 'module' object has no attribute '__all__'

我确信它指的是正确的python二进制文件。

:~$ ls -la `which python`
lrwxrwxrwx 1 root root 9 Sep  9  2016 /usr/bin/python -> python2.7

我尝试重新安装python2.7,但没有帮助。

sudo apt-get -y --reinstall install python2.7 python-pip python-dev

0 个答案:

没有答案