Search code examples
pythondjangoimporterrorsimplejson

ImportError at /admin/


I'm try to run my aplication and my server showme that.

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']

Solution

  • The problem is with django-smart-select and the compatibility with the version of django you are using. django-smart-select use simplejson instead of json. To solve this open views.py in django-smart-select and change: from django.utils import simplejson for import json as simplejson