0

I have got this response. I have no idea how to avoid it:

Traceback (most recent call last):
  File "/home/pi/Franz/email3.py", line 2, in <module>
    import smtplib
  File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
    module = self._original_import(*args, **kw)
  File "/usr/lib/python3.5/smtplib.py", line 47, in <module>
    import email.utils
  File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
    module = self._original_import(*args, **kw)
  File "/home/pi/Franz/email.py", line 2, in <module>
    from email.mime.text import MIMEText
  File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
    module = self._original_import(*args, **kw)
ImportError: No module named 'email.mime'; 'email' is not a package
  • 4
    Add your code to the question. And rename your script. Python cannot handle scripts that have the same name as installed modules (email.py in this case) – Dirk Jan 13 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.