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功能的其他包都改成新改的包名,然后问题就麻烦了.