在/ admin /的ImportError

时间:2014-10-14 17:19:54

标签: python django importerror simplejson

我正在尝试运行我的应用程序,我的服务器告诉我。

ImportError at /admin/

cannot import name simplejson

Request Method:     GET
Request URL:    Local IP:8000
Django Version:     1.7
Exception Type:     ImportError
Exception Value:    

cannot import name simplejson

Exception Location:     /usr/lib/python2.7/importlib/__init__.py in import_module, line 37
Python Executable:  /usr/bin/python
Python Version:     2.7.6
Python Path:    

['/home/arturo/workspace/claver',
 '/usr/local/lib/python2.7/dist-packages/django_smart_selects-1.0.9-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/simplejson-3.6.4-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/django_ajax_selects-1.3.5-py2.7.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

1 个答案:

答案 0 :(得分:3)

问题在于django-smart-select以及与您正在使用的django版本的兼容性。 django-smart-select使用simplejson而不是json。要在django-smart中解决这个打开views.py,请选择并更改:来自django.utils import simplejson import json as simplejson