Django+Bootstrap4 raise Error: "mysqlclient 1.4.0 or newer is required; you have 0.10.0."

  bootstrap-4, django, mysql, python

I Use Django 3.1.2 with MySQL, and it worked normal with database.
But affter i’ve installed Botstrap 4 (pip install bootstrap4) and load it in my Tamplate {% load bootstrap4 %} i get Error:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.0. raised by bootstrap as you can see bellow.

But in my venv i have installed module mysqlclient version 2.0.1 (not 0.10.0). (As PyCharm show me.)

I don`t understend it.
And how css/js library like bootstrap even apply to Database engine?

How to solve it?

"C:Program FilesJetBrainsPyCharm 2019.3.3binrunnerw64.exe" C:MyProjectvenvScriptspython.exe C:/MyProgect/MySite/manage.py runserver 8000
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:UsersUserAnaconda3libthreading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:UsersUserAnaconda3libthreading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangoutilsautoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangocoremanagementcommandsrunserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangoutilsautoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangocoremanagement__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangoutilsautoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjango__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangoappsregistry.py", line 114, in populate
    app_config.import_models()
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangoappsconfig.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:UsersUserAnaconda3libimportlib__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 "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangocontribauthmodels.py", line 2, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangocontribauthbase_user.py", line 48, in <module>
    class AbstractBaseUser(models.Model):
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbmodelsbase.py", line 122, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbmodelsbase.py", line 326, in add_to_class
    value.contribute_to_class(cls, name)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbmodelsoptions.py", line 206, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodb__init__.py", line 28, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbutils.py", line 214, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbutils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "C:UsersUserAnaconda3libimportlib__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:UsersUserITResearchall_gid_2venvlibsite-packagesdjangodbbackendsmysqlbase.py", line 36, in <module>
    raise ImproperlyConfigured('mysqlclient 1.4.0 or newer is required; you have %s.' % Database.__version__)
**django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.0.**

Source: Python Questions

2 thoughts on - Django+Bootstrap4 raise Error: "mysqlclient 1.4.0 or newer is required; you have 0.10.0."

LEAVE A COMMENT