ImportError:无法导入名称MAXREPEAT

时间:2013-06-28 10:56:48

标签: python

重新编译python2.7和mod_wgsi后,我尝试运行pip或easy_install时,在虚拟环境中出现这些错误。

# pip-2.7 install pexpect
Traceback (most recent call last):
  File "/production/pythonenv/django15/bin/pip-2.7", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/production/pythonenv/django15/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 16, in <module>
  File "/production/pythonenv/django15/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/production/pythonenv/django15/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/production/pythonenv/django15/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/production/pythonenv/django15/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT

但是,如果我进入python,我可以导入_sre,但似乎没有正确的方法可用。

>>> import _sre
>>> dir(_sre)
['CODESIZE', 'MAGIC', '__doc__', '__name__', '__package__', 'compile', 'copyright', 'getcodesize', 'getlower']

任何想法......谢谢,

0 个答案:

没有答案