Twisted Error when i run any URL
hackermanxyz opened this issue · 1 comments
when i run any URL like " python xsscrapy.py -u https://example.com "
so i got this error.
2022-02-09 22:19:55 [scrapy] INFO: Enabled extensions:
['scrapy.extensions.logstats.LogStats',
'scrapy.extensions.telnet.TelnetConsole',
'scrapy.extensions.corestats.CoreStats']
Unhandled error in Deferred:
2022-02-09 22:19:55 [twisted] CRITICAL: Unhandled error in Deferred:
2022-02-09 22:19:55 [twisted] CRITICAL:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1299, in _inlineCallbacks
result = g.send(result)
File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 90, in crawl
six.reraise(*exc_info)
File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 72, in crawl
self.engine = self._create_engine()
File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 97, in _create_engine
return ExecutionEngine(self, lambda _: self.stop())
File "/usr/local/lib/python2.7/dist-packages/scrapy/core/engine.py", line 66, in init
self.scheduler_cls = load_object(self.settings['SCHEDULER'])
File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/misc.py", line 44, in load_object
mod = import_module(module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/scrapy/core/scheduler.py", line 6, in
from queuelib import PriorityQueue
File "/usr/local/lib/python2.7/dist-packages/queuelib/init.py", line 1, in
from queuelib.queue import FifoDiskQueue, LifoDiskQueue
File "/usr/local/lib/python2.7/dist-packages/queuelib/queue.py", line 7, in
from contextlib import suppress
ImportError: cannot import name suppress
No promises, but downgrading queuelib may fix the issue:
pip uninstall attrs
pip uninstall queuelib
pip install queuelib==1.5.0
pip install attrs
It looks like modern versions of some of those libraries require python3. If that doesn't work I might be able to find my working version and get a version locked requirements.txt for you