重新编译 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']
任何想法......谢谢,