Python遇到ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package问题的处理办法...

写Python的时候我们会遇到如下的错误:

Traceback (most recent call last):
File "F:/exploitation/codes/python/Jet-python1/python_code_1/tools/email.py", line 2, in
import smtplib
File "F:\exploitation\codes\python\Python_all_environment\lib\smtplib.py", line 47, in
import email.utils
File "F:\exploitation\codes\python\Jet-python1\python_code_1\tools\email.py", line 3, in
from email.mime.text import MIMEText
ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package

有两种可能

第一:

  未导入包

第二:

  包名和文件名冲突

Python遇到ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package问题的处理办法..._第1张图片

  

  只需要将文件名修改一下便可以,注意这个问题就好

 

转载于:https://www.cnblogs.com/future-dream/p/10263600.html

你可能感兴趣的:(Python遇到ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package问题的处理办法...)