Importerror: Cannot Import Name 'Jsonfield'

Importerror: Cannot Import Name 'Jsonfield'

I'm getting the error:

  File "/home/mark/Nova/nova/lib/fields.py", line 1, in <module>
    from django.contrib.postgres.fields import JSONField
ImportError: cannot import name 'JSONField'

when I run python manage.py runserver 0.0.0.0:8888. Even though I already have simplejson installed.

pip freeze shows,

alabaster==0.7.12
Babel==2.7.0
bcdoc==0.16.0
boto3==0.0.21
botocore==1.0.0b3
certifi==2019.9.11
chardet==3.0.4
defusedxml==0.6.0
Django==1.8.2
django-bulk-update==1.1.4
django-cors-headers==2.0.2
django-facebook==6.0.3
django-pgjsonb==0.0.15
django-redis==4.2.0
django-revproxy==0.9.7
djangorestframework==3.1.3
djangorestframework-httpsignature==1.0.0
docutils==0.15.2
elasticsearch==1.6.0
facebook-sdk==1.0.0
filemagic==1.6
futures==2.2.0
geopy==1.11.0
google-api-python-client==1.5.0
httplib2==0.14.0
httpsig==1.3.0
idna==2.8
Jinja2==2.10.3
jmespath==0.7.1
MarkupSafe==1.1.1
mock==1.0.1
mongoengine==0.10.0
msgpack-python==0.5.6
nose==1.3.7
oauth2client==2.2.0
oauthlib==3.1.0
Pillow==2.8.2
psycopg2==2.8.4
py2neo==2.0.8
pyasn1==0.4.7
pyasn1-modules==0.2.7
pycryptodome==3.9.0
Pygments==2.4.2
PyJWT==1.7.1
pymongo==3.0.3
PySocks==1.7.1
python-dateutil==2.8.0
python-social-auth==0.2.10
python3-memcached==1.51
python3-openid==3.1.0
python3-pika==0.9.14
pytz==2019.3
redis==2.10.3
requests==2.2.1
requests-oauthlib==1.2.0
rsa==4.0
simplejson==3.7.3
six==1.12.0
snowballstemmer==2.0.0
Sphinx==1.3.1
sphinx-rtd-theme==0.1.9
sphinxcontrib-httpdomain==1.3.1
treelib==1.3.0
twilio==5.6.0
Unidecode==1.1.1
uritemplate==0.6
urllib3==1.10.1

What would be the fix for this?

1 Answer

JSONField was added in Django 1.9 and you're using Django 1.8.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.