Ich habe den folgenden Fehler beim Versuch, Scrapy in Python 3 zu verwenden. Ich benutze Ubuntu 16.04 und die Installation python3-twisted
hat das Problem nicht gelöst.Twisted Import Fehler bei der Verwendung von Scrapy in Python 3
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/crawler.py", line 150, in crawl
crawler = self._create_crawler(crawler_or_spidercls)
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/crawler.py", line 166, in _create_crawler
return Crawler(spidercls, self.settings)
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/crawler.py", line 46, in __init__
self.extensions = ExtensionManager.from_crawler(self)
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/middleware.py", line 56, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/middleware.py", line 32, in from_settings
mwcls = load_object(clspath)
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/utils/misc.py", line 44, in load_object
mod = import_module(module)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/extensions/memusage.py", line 16, in <module>
from scrapy.mail import MailSender
File "/home/fran/.local/lib/python3.5/site-packages/scrapy/mail.py", line 23, in <module>
from twisted.mail.smtp import ESMTPSenderFactory
ImportError: No module named 'twisted.mail.smtp'
Vielleicht versuchen verdreht 'sudo apt-get zu installieren installiere Python-Twis ted' –
Auch versucht, dass ohne Erfolg – FranGoitia
@FranGoitia, welche Version von Scrapy verwenden Sie? Es scheint mir, dass Sie Scrapy <= 1.0 verwenden, was NICHT python3-kompatibel ist. Diese Zeile 23 ['from twisted.mail.smtp Import ESMTPSenderFactory'] (https://github.com/scrapy/scrapy/blob/1.0/scrapy/mail.py) wurde [in Scrapy 1.1 verschoben] (https: // github.com/scrapy/scrapy/blob/1.1/scrapy/mail.py). Bitte upgrade auf Scrapy 1.1 –