我试图用Django的国际化,并为此不得不安装gettext的。 现在,我得到这个尴尬的错误任何时候我尝试启动我的应用程序:
Traceback (most recent call last):
File "/var/www/mydjangoproject/manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 4, in <module>
from optparse import OptionParser, NO_DEFAULT
File "/usr/lib/python2.7/optparse.py", line 418, in <module>
_builtin_cvt = { "int" : (_parse_int, _("integer")),
File "/usr/lib/python2.7/gettext.py", line 581, in gettext
return dgettext(_current_domain, message)
File "/usr/lib/python2.7/gettext.py", line 545, in dgettext
codeset=_localecodesets.get(domain))
File "/usr/lib/python2.7/gettext.py", line 480, in translation
mofiles = find(domain, localedir, languages, all=1)
File "/usr/lib/python2.7/gettext.py", line 437, in find
for nelang in _expand_lang(lang):
File "/usr/lib/python2.7/gettext.py", line 131, in _expand_lang
from locale import normalize
ImportError: cannot import name normalize
图书馆locale.py存在,我可以进口。 Django的1.4 Python的2.7.2+下运行。 有任何想法吗?