Django: python manage.py runserver gives RuntimeError: maximum recursion depth exceeded in cmp -


i trying learn django form 1st tutorial on django project website. might missing obvious but, after following instructions when come run command

python manage.py runserver 

i error posted @ end of plea (i have posted first few lines of repeated lines of error message brevity).

here of solutions/suggestions have found on web not helpful me.

1)sys.setrecursionlimit(1500).

this didn't work me.

2).django runtimeerror: maximum recursion depth exceeded

this isn't option because not using pydev, tried uninstalling , installing django using pip didn't fix , using mountain lion's native python, not going uninstall, since not recommended.

3). tried:

 python manage.py runserver --settings=mysite.settings 

same exact error command without option settings

any suggestions, recommendations appreciated. using.... django official version. 1.5.1 installed using pip , python 2.7.2

unhandled exception in thread started <bound method command.inner_run of <django.contrib.staticfiles.management.commands.runserver.command object @ 0x10f7ee5d0>> traceback (most recent call last):   file "/library/python/2.7/site-packages/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/core/management/base.py", line 280, in validate     num_errors = get_validation_errors(s, app)   file "/library/python/2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors     (app_name, error) in get_app_errors().items():   file "/library/python/2.7/site-packages/django/db/models/loading.py", line 166, in get_app_errors     self._populate()   file "/library/python/2.7/site-packages/django/db/models/loading.py", line 72, in _populate     self.load_app(app_name, true)   file "/library/python/2.7/site-packages/django/db/models/loading.py", line 96, in load_app     models = import_module('.models', app_name)   file "/library/python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module     __import__(name)   file "/library/python/2.7/site-packages/django/contrib/auth/models.py", line 370, in <module>     class abstractuser(abstractbaseuser, permissionsmixin):   file "/library/python/2.7/site-packages/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/db/models/base.py", line 265, in add_to_class     value.contribute_to_class(cls, name)   file "/library/python/2.7/site-packages/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/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 <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),   file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/functools.py", line 56, in <lambda>     '__lt__': [('__gt__', lambda self, other: other < self),    runtimeerror: maximum recursion depth exceeded in cmp 

update: ended doing overkill of installing virtualbox, installing free ubuntu on , moving on finish tutorial...oh well!

the problem in functools.py file. file python. have installed new version of python 2.7.5 , file wrong (i have - older installation of python 2.7.5 , there file functools.py correct)

to fix problem replace (about line 56 in 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)] } 

to that:

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 , 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 , not self == other),                ('__lt__', lambda self, other: not self >= other)] } 

read also: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -