AttributeError: module ‘MySQLdb.constants.FIELD_TYPE’ has no attribute ‘JSON’ while migrating in Django

I do not know in what way solve this error. Any hints? I have simple Django projects and receive this error when try to do python3 manage.py migrate. This is related to any programming error in app or this is possible there is any error related to installation of mysql and completeness of its packages? Maybe there is any error in manage.py file? Or maybe this is case in not compatible version of Django and mysql?

Traceback (most recent call last):
 File "manage.py", line 23, in <module>
execute_from_command_line(sys.argv)
File "/home/anna/.local/lib/python3.7/site-packages/django/core/management/__init__.py",      
line 401, in execute_from_command_line
utility.execute()
File "/home/anna/.local/lib/python3.7/site-packages/django/core/management/__init__.py",    
line 377, in execute
django.setup()
File "/home/anna/.local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/anna/.local/lib/python3.7/site-packages/django/apps/registry.py", line 114, in     
populate
app_config.import_models()
File "/home/anna/.local/lib/python3.7/site-packages/django/apps/config.py", line 211, in   
import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/anna/.local/lib/python3.7/site-packages/django/contrib/auth/models.py", line 2,   
in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/home/anna/.local/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 
48, in <module>
class AbstractBaseUser(models.Model):
File "/home/anna/.local/lib/python3.7/site-packages/django/db/models/base.py", line 122, in 
__new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/anna/.local/lib/python3.7/site-packages/django/db/models/base.py", line 326, in 
add_to_class
value.contribute_to_class(cls, name)
File "/home/anna/.local/lib/python3.7/site-packages/django/db/models/options.py", line 206, 
in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/home/anna/.local/lib/python3.7/site-packages/django/db/__init__.py", line 28, in 
__getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/anna/.local/lib/python3.7/site-packages/django/db/utils.py", line 214, in 
__getitem__
backend = load_backend(db['ENGINE'])
File "/home/anna/.local/lib/python3.7/site-packages/django/db/utils.py", line 111, in 
load_backend
return import_module('%s.base' % backend_name)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/anna/.local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 
29, in <module>
from .introspection import DatabaseIntrospection            # isort:skip
File "/home/anna/.local/lib/python3.7/site-
packages/django/db/backends/mysql/introspection.py", line 16, in <module>
class DatabaseIntrospection(BaseDatabaseIntrospection):
File "/home/anna/.local/lib/python3.7/site-   
packages/django/db/backends/mysql/introspection.py", line 27, in DatabaseIntrospection
FIELD_TYPE.JSON: 'JSONField',
AttributeError: module 'MySQLdb.constants.FIELD_TYPE' has no attribute 'JSON'

1

pip install mysqlclient==2.0.1

You need to update mysqlclient, version 2.0.1 is the current version and it solves this missing definition.

2

I got the same error and I realised later that I wasn’t running my code in virtual environment. Maybe you forgot to activate virtual environment.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật