python - ImportError:无法导入名称“JSONField”
问题描述
我收到错误:
File "/home/mark/Nova/nova/lib/fields.py", line 1, in <module>
from django.contrib.postgres.fields import JSONField
ImportError: cannot import name 'JSONField'
当我跑步时python manage.py runserver 0.0.0.0:8888
。虽然我已经simplejson
安装了。
pip freeze
显示,
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
有什么办法解决这个问题?
解决方案
JSONField
在 Django 1.9 中添加并且您使用的是 Django 1.8.2
推荐阅读
- pentaho - 在 pentaho 表组件 cde 中添加子行
- git - 如何在提交到分支时触发 Jenkins 流水线?
- vb.net - 使用参数时为原始布尔值赋值
- hadoop - Homebrew 安装特定版本的 hadoop 2.8.0 而不是 3.1.1
- docker - 复制目录覆盖目标
- ios - UITableView contentSize 没有更新
- javascript - 使用异步操作 Vuex 加载状态
- r - Tidyverse 使用来自其他数据帧的行数据收集
- php - ElasticSearch Count API , php 中多次计为一个请求
- javascript - JS - 找到小于或等于给定界限的最大整数,该界限可被某个数字整除