1

So, I used this program from https://gist.github.com/johnantoni/8199088 To use for sending emails. I replaced everything with my own info, ie username, password, who it is to. But when I run it I get this error:

Traceback (most recent call last): File "ip_sender.py", line 2, in <module> import smtplib File "/usr/lib/python2.7/smtplib.py", line 46, in <module> import email.utils File "/home/pi/email.py", line 4, in <module> ImportError: No module named mime.text

I don't understand what I'm supposed to do to fix it? Please help, thank you so much.

asked Oct 23, 2018 at 6:49

1 Answer 1

2

The problem is that Python is trying to import a particular module, but can't find it. In this particular case, the module is email.mime.text which is part of the standard Python distribution. The problem as reported is that it says it can't find mime.text and the reason for this is that you have named your program email.py which effectively hides the email libraries from Python. Rename your file to something else and the problem should be resolved.

answered Oct 23, 2018 at 13:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.