x4nth055/pythoncode-tutorials

AttributeError: 'module' object has no attribute 'message_from_bytes'

johann-lau opened this issue · 4 comments

Traceback (most recent call last):
  File "Inbox.py", line 37, in <module>
    msg = email.message_from_bytes(response[1])
AttributeError: 'module' object has no attribute 'message_from_bytes'

Hey @johann-lau ,

email module does have message_from_bytes() method, make sure you:

  • Have Python 3.3+.
  • Do not have email.py file in the current directory, as it'll load it instead of the email module from the Python standard library.

Please let me know if this solved your issue.

Please close the issue when you solve it.

Thanks!

Thanks very much! I renamed another file Email.py and this issue was solved :)