zoukankan      html  css  js  c++  java
  • 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()
  • 相关阅读:
    使用EF批量新增数据十分缓慢
    EF中获取当前上下文的表名
    下拉框停用数据的处理
    CEILING保留n位小数向上取整
    MVC ValidationAttribute 验证一个字段必须大于另一个字段
    EF通过导航属性取出从表的集合后,无法删除子表
    我得新博客上线了采用Vue+Layui的结合开发,后台采用asp.net mvc
    CTS,CLS,CLR解释
    Linq与委托
    C#4.0的十种语法糖
  • 原文地址:https://www.cnblogs.com/sewen-H/p/13335325.html
Copyright © 2011-2022 走看看