Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

python - ubuntu ImportError: cannot import name MAXREPEAT

Upgrade to 13.04 has totally messed my system up . I am having this issue when running

     ./manage.py runserver


Traceback (most recent call last):
File "./manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
File "/home/rats/rats/local/lib/python2.7/site-packages/django/core/management   
/__init__.py", line 4, in <module>
from optparse import OptionParser, NO_DEFAULT
File "/usr/lib/python2.7/optparse.py", line 77, in <module>
import textwrap
File "/usr/lib/python2.7/textwrap.py", line 10, in <module>
import string, re
File "/usr/lib/python2.7/string.py", line 83, in <module>
import re as _re
File "/home/rats/rats/lib/python2.7/re.py", line 105, in <module>
import sre_compile
File "/home/rats/rats/lib/python2.7/sre_compile.py", line 14, in <module>
import sre_parse
File "/home/rats/rats/lib/python2.7/sre_parse.py", line 17, in <module>
from sre_constants import *
File "/home/rats/rats/lib/python2.7/sre_constants.py", line 18, in <module>
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT

this is happening for both the real environment as well as for virtual environment . i tried removing python with

sudo apt-get remove python

and sadly it has removed everything . now google chrome does not show any fonts . i am looking for getting things back to work . help is needed for proper configuring it again.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you are using virtualenvwrapper then you can recreate the virtualenv on top of the existing one (with no environment currently active):

mkvirtualenv <existing name>

which should pull in the latest (upgraded) python version from the system and fix any mismatch errors.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...