ImportError: No module named 'twisted.mail.smtp'
See original GitHub issueI use scrapy in python3.5, when I try to send a mail by MailSender, it’s crashed.
File "/home/guangyao/Documents/Code/financer_crawl/env/lib/python3.5/site-packages/scrapy/mail.py", line 85, in send
dfd = self._sendmail(rcpts, msg.as_string())
File "/home/guangyao/Documents/Code/financer_crawl/env/lib/python3.5/site-packages/scrapy/mail.py", line 108, in _sendmail
from twisted.mail.smtp import ESMTPSenderFactory
ImportError: No module named 'twisted.mail.smtp'
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
python - Scrapy - No module named mail.smtp - Stack Overflow
I had same problem. installing twisted solved the problem. sudo apt-get install python-twisted.
Read more >[Twisted-Python] Twisted.email.smtp Module ERROR
Previous message: [Twisted-Python] Twisted.email.smtp Module ERROR ... the error as import error : no module >name mail.smtp. so please someone help me to ......
Read more >sslstrip ImportError: No module named twisted.web - Super User
I was having some difficulty installing sslstrip too. This is what worked for me. I started with a fresh copy of kali then...
Read more >Release 22.10.0.post0 Twisted Matrix Labs
Twisted Mail Tutorial: Building an SMTP Client from Scratch . ... If it reports an error (“No module named calculus”), double check you...
Read more >Crawl fails because folder.items is not found - Google Groups
/usr/lib/python2.6/site-packages/twisted/python/filepath.py:12: ... mail/smtp.py:10: exceptions. ... ImportError: No module named items
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MrLokans I think you can use smtplib and email packages from standard library; see https://docs.python.org/3/library/email-examples.html. They are blocking though - it means that all processing will stop while email is waiting to be sent. So make sure sending is fast: run a local daemon (exim, postfix) and use it to send emails, so that when you call “send email” the message is put to a local queue, and then daemon handles the rest. Using e.g. gmail smtp interface directly is worse because it can be much slower.
@duangy , thanks for reporting. Unfortunately, Scrapy does not support sending mail with Python 3. This is actually a limitation of Twisted, which has not ported its
twisted.mail
module yet: see https://twistedmatrix.com/trac/ticket/8770 and https://github.com/twisted/twisted/pull/509#issuecomment-242239177