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.
1 Answer 1
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.