Unable to import Python's email module at all

后端 未结 5 1700
故里飘歌
故里飘歌 2020-12-03 00:55

I can\'t seem to import the email module at all. Every time I do it I get an error. I\'ve tried uninstalling Python and reinstalling, but the email module just refuses to wo

5条回答
  •  無奈伤痛
    2020-12-03 01:24

    I just came across this error and wanted to share my solution. In my case, I had a file named email.py in directory. This created a name conflict between Python's email.py and my file. When smtplib tried to import email.utils it looked and my file and didn't find anything. After I renamed my copy of email.py into myemail.py everything worked like a charm.

提交回复
热议问题