开发者

'JSONDecoder' object has no attribute 'object_pairs_hook' error

开发者 https://www.devze.com 2023-02-14 18:22 出处:网络
this is my error : (mysite)zjm1126@zjm1126-G41MT-S2:~/Code/trinity_src$ python manage_dev.py runserver

this is my error :

(mysite)zjm1126@zjm1126-G41MT-S2:~/Code/trinity_src$ python manage_dev.py runserver
Validating models...
Unhandled exception in thread started by <function inner_run at 0xa20c064>
Traceback (most recent call last):
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 48, in inner_run
    self.validate(display_num_errors=True)
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/h开发者_StackOverflow中文版ome/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/home/zjm1126/zjm_test/mysite/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/zjm1126/Code/trinity_src/apps/__init__.py", line 9, in <module>
    from rekoo_lib.platform import Platform,MobileResponseRedirect,MobileResponse
  File "/home/zjm1126/Code/trinity_src/rekoo_lib/__init__.py", line 2, in <module>
    from rekoo_lib.common import model
  File "/home/zjm1126/Code/trinity_src/rekoo_lib/common/model.py", line 5, in <module>
    from rekoo_lib.common.utils import cache
  File "/home/zjm1126/Code/trinity_src/rekoo_lib/common/utils.py", line 18, in <module>
    from rekoo_lib.common import simplejson
  File "/home/zjm1126/Code/trinity_src/rekoo_lib/common/simplejson/__init__.py", line 238, in <module>
    _default_decoder = JSONDecoder(encoding=None, object_hook=None)
  File "/home/zjm1126/Code/trinity_src/rekoo_lib/common/simplejson/decoder.py", line 322, in __init__
    self.scan_once = make_scanner(self)
AttributeError: 'JSONDecoder' object has no attribute 'object_pairs_hook'

what can i do ,

thanks


According to this bug report in Django this can be caused by not importing simplejson using:

from django.utils import simplejson

It seems that you might be experiencing a conflict between the version of simplejson included with Django and the one included with rekoo_lib. I can't find anything useful about rekoo_lib online, but if you install simplejson externally Django will use that over its internal version, rekoo_lib might do the same and that would solve your problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号