Django RuntimeError: se excedió la profundidad máxima de recursión

Soy nuevo en Django. Instalé Django usando easy_install (en una Mac) y el complemento PyDev Django para eclipse. Seguí los procedimientos estándar para crear un nuevo proyecto PyDev Django. Cuando bash ejecutar el proyecto como PyDev: Django, aparece el siguiente error.

Validating models... RuntimeError: maximum recursion depth exceeded 

También intenté agregar la siguiente línea en manage.py, pero no sirve de nada.

 sys.setrecursionlimit(2000) 

Aquí está el astackmiento parcial.

 Unhandled exception in thread started by <bound method Command.inner_run of > Traceback (most recent call last): File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/core/management/commands/runserver.py", line 92, in inner_run self.validate(display_num_errors=True) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/core/management/base.py", line 280, in validate num_errors = get_validation_errors(s, app) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/core/management/validation.py", line 35, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/loading.py", line 166, in get_app_errors self._populate() File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/loading.py", line 72, in _populate self.load_app(app_name, True) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/loading.py", line 96, in load_app models = import_module('.models', app_name) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/contrib/auth/models.py", line 370, in  class AbstractUser(AbstractBaseUser, PermissionsMixin): File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/base.py", line 213, in __new__ new_class.add_to_class(field.name, copy.deepcopy(field)) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/base.py", line 265, in add_to_class value.contribute_to_class(cls, name) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/fields/__init__.py", line 257, in contribute_to_class cls._meta.add_field(self) File "/Library/Python/2.7/site-packages/Django-1.5-py2.7.egg/django/db/models/options.py", line 179, in add_field self.local_fields.insert(bisect(self.local_fields, field), field) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in  '__lt__': [('__gt__', lambda self, other: other < self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in  '__lt__': [('__gt__', lambda self, other: other < self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in  '__lt__': [('__gt__', lambda self, other: other < self), File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/functools.py", line 56, in  '__lt__': [('__gt__', lambda self, other: other < self), 

¿Qué estoy haciendo mal?

El problema está en el archivo functools.py. Este archivo es de Python.

Para solucionar el problema, reemplace esto (sobre la línea 56 en python \ Lib \ fuctools.py):

  convert = { '__lt__': [('__gt__', lambda self, other: other < self), ('__le__', lambda self, other: not other < self), ('__ge__', lambda self, other: not self < other)], '__le__': [('__ge__', lambda self, other: other <= self), ('__lt__', lambda self, other: not other <= self), ('__gt__', lambda self, other: not self <= other)], '__gt__': [('__lt__', lambda self, other: other > self), ('__ge__', lambda self, other: not other > self), ('__le__', lambda self, other: not self > other)], '__ge__': [('__le__', lambda self, other: other >= self), ('__gt__', lambda self, other: not other >= self), ('__lt__', lambda self, other: not self >= other)] } 

a ese:

  convert = { '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)), ('__le__', lambda self, other: self < other or self == other), ('__ge__', lambda self, other: not self < other)], '__le__': [('__ge__', lambda self, other: not self <= other or self == other), ('__lt__', lambda self, other: self <= other and not self == other), ('__gt__', lambda self, other: not self <= other)], '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)), ('__ge__', lambda self, other: self > other or self == other), ('__le__', lambda self, other: not self > other)], '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other), ('__gt__', lambda self, other: self >= other and not self == other), ('__lt__', lambda self, other: not self >= other)] } 

Lea también: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/

Quité PyDev, Django y Python y los reinstalé todos, y ahora funciona. ¡Gracias!

Me he encontrado con esto un par de veces al usar pyenv virtualenvs con python 2.7.1. No quería editar los archivos principales, así que actualicé a 2.7.5 y funcionó a la perfección. Esperemos que esta sea una opción para algunos de ustedes.