• ModuleNotFoundError: No module named 'email.utils'问题


    D:python_learnmeiduo_projectenvScriptspython.exe D:/python_learn/meiduo_project/meiduo_mall/manage.py runserver 8000
    Traceback (most recent call last):
    File "D:/python_learn/meiduo_project/meiduo_mall/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocoremanagement\__init__.py", line 13, in <module>
    from django.core.management.base import (
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangocoremanagementase.py", line 17, in <module>
    from django.db.migrations.exceptions import MigrationSchemaMissing
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmigrations\__init__.py", line 2, in <module>
    from .operations import * # NOQA
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmigrationsoperations\__init__.py", line 1, in <module>
    from .fields import AddField, AlterField, RemoveField, RenameField
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmigrationsoperationsfields.py", line 4, in <module>
    from django.db.models.fields import NOT_PROVIDED
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodels\__init__.py", line 3, in <module>
    from django.db.models.aggregates import * # NOQA
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsaggregates.py", line 5, in <module>
    from django.db.models.expressions import Func, Star
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsexpressions.py", line 6, in <module>
    from django.db.models import fields
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangodbmodelsfields\__init__.py", line 14, in <module>
    from django import forms
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoforms\__init__.py", line 6, in <module>
    from django.forms.boundfield import * # NOQA
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoformsoundfield.py", line 6, in <module>
    from django.forms.utils import flatatt, pretty_name
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoformsutils.py", line 10, in <module>
    from django.utils.html import escape, format_html, format_html_join, html_safe
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoutilshtml.py", line 10, in <module>
    from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS
    File "D:python_learnmeiduo_projectenvlibsite-packagesdjangoutilshttp.py", line 11, in <module>
    from email.utils import formatdate
    ModuleNotFoundError: No module named 'email.utils'
    
    Process finished with exit code 1

    把自己定义的叫email的包改成其他名称,自己定义的名称和系统名称冲突了.

    在pycharm中修改包的名称的时候千万不要点跟随修改,这样会把模块内的其他引用email功能的其他包都改成新改的包名,然后问题就麻烦了.

  • 相关阅读:
    java基础(六):RabbitMQ 入门
    Spring Boot 入门(六):集成 treetable 和 zTree 实现树形图
    Geoserver+Openlayers拉框查询
    Spring Boot 入门(五):集成 AOP 进行日志管理
    Spring boot 入门(四):集成 Shiro 实现登陆认证和权限管理
    java基础(五):谈谈java中的多线程
    java基础(四):谈谈java中的IO流
    java基础(三):谈谈java异常的处理
    java基础(二):谈谈Java基本数据结构
    Java编译时常量和运行时常量
  • 原文地址:https://www.cnblogs.com/sewen-H/p/13339978.html
Copyright © 2020-2023  润新知