• django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.迁移文件时问题


    (env) D:python_learnmeiduo_projectmeiduo_mall>python manage.py makemigrations
    Traceback (most recent call last):
      File "manage.py", line 22, in <module>
        execute_from_command_line(sys.argv)
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocoremanagement\__init__.py", line 401, in execute_from_command_line
        utility.execute()
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocoremanagement\__init__.py", line 377, in execute
        django.setup()
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjango\__init__.py", line 24, in setup
        apps.populate(settings.INSTALLED_APPS)
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoapps
    egistry.py", line 114, in populate
        app_config.import_models()
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoappsconfig.py", line 211, in import_models
        self.models_module = import_module(models_module_name)
      File "D:PythonPython38libimportlib\__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
      File "<frozen importlib._bootstrap>", line 991, in _find_and_load
      File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 783, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocontribauthmodels.py", line 2, in <module>
        from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocontribauthase_user.py", line 47, in <module>
        class AbstractBaseUser(models.Model):
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsase.py", line 121, in __new__
        new_class.add_to_class('_meta', Options(meta, app_label))
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsase.py", line 325, in add_to_class
        value.contribute_to_class(cls, name)
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsoptions.py", line 208, in contribute_to_class
        self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodb\__init__.py", line 28, in __getattr__
        return getattr(connections[DEFAULT_DB_ALIAS], item)
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbutils.py", line 207, in __getitem__
        backend = load_backend(db['ENGINE'])
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbutils.py", line 111, in load_backend
        return import_module('%s.base' % backend_name)
      File "D:PythonPython38libimportlib\__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbackendsmysqlase.py", line 37, in <module>
        raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
    django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

    import
    pymysql pymysql.version_info=(1,3,13,"final",0) #添加此行代码 pymysql.install_as_MySQLdb()
  • 相关阅读:
    自适应图形的绘制
    红色椭圆、蓝色正方形、黄色三角形、紫色五角星
    [2020牛客寒假算法基础集训营2]G-判正误
    [2020牛客寒假算法基础集训营1]I-nico和niconiconi
    [2020牛客寒假算法基础集训营1]H-nozomi和字符串
    [2020牛客寒假算法基础集训营1]A-honoka和格点三角形
    约瑟夫环以及其变种集合
    unsign long long 与 long long
    【POJ-3279】Fliptile
    B--Bookshelf 2
  • 原文地址:https://www.cnblogs.com/sewen-H/p/13335325.html
Copyright © 2020-2023  润新知