使用werkzeug时出错:ModuleNotFoundError:没有名为“ email.Utils”的模块; “电子邮件”不是软件包

时间:2018-06-26 19:34:01

标签: python flask werkzeug

我正在尝试在virtualenv中运行flask文件,但请继续运行以下回溯。

traceback (most recent call last):
  File "models.py", line 1, in <module>
    from werkzeug.security import generate_password_hash, check_password_hash
  File "C:\Users\cinch\Desktop\fullstack\apis\myApi\lib\site-packages\werkzeug\__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "C:\Users\cinch\Desktop\fullstack\apis\myApi\lib\site-packages\werkzeug\exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "C:\Users\cinch\Desktop\fullstack\apis\myApi\lib\site-packages\werkzeug\wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "C:\Users\cinch\Desktop\fullstack\apis\myApi\lib\site-packages\werkzeug\http.py", line 25, in <module>
    from email.Utils import parsedate_tz
ModuleNotFoundError: No module named 'email.Utils'; 'email' is not a package

即使是空的python文件,我也会收到此错误。 我应该如何解决这个问题?我尝试重新安装烧瓶

我在conda环境中运行了相同的脚本,并设法遇到了相同的问题。

Traceback (most recent call last):
  File "models.py", line 1, in <module>
    from werkzeug.security import generate_password_hash, check_password_hash
  File "C:\Users\cinch\Anaconda3\lib\site-packages\werkzeug\__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "C:\Users\cinch\Anaconda3\lib\site-packages\werkzeug\exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "C:\Users\cinch\Anaconda3\lib\site-packages\werkzeug\wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "C:\Users\cinch\Anaconda3\lib\site-packages\werkzeug\http.py", line 25, in <module>
    from email.Utils import parsedate_tz
ModuleNotFoundError: No module named 'email.Utils'; 'email' is not a package

我将感谢所有补救措施/建议。

0 个答案:

没有答案