Python遇到的问题和解决方法汇总
1、报错:ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package
Traceback (most recent call last):
File "E:\pythonProject\common\email.py", line 3, in <module>
import smtplib
File "E:\Python3.10.1\lib\smtplib.py", line 47, in <module>
import email.utils
File "E:\pythonProject\common\email.py", line 4, in <module>
from email.mime.text import MIMEText
ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package
有两种可能:
①、未导入包;
②、包名和文件名冲突;
2、报错提示:TypeError: Student() takes no arguments
这个时候检查一下构造函数部分的__init__是不是写成了__int__!
3、