Start a new topic

+Shifting Project From Python 2 to 3 Does not Deploy

So I get this error while trying to deploy a scrapy repo which I shifted from pyhon 2 to 3:
  File "/usr/local/lib/python2.7/site-packages/sh_scrapy/", line 148, in _run_usercode
    _run(args, settings)
  File "/usr/local/lib/python2.7/site-packages/sh_scrapy/", line 103, in _run
    _run_scrapy(args, settings)
  File "/usr/local/lib/python2.7/site-packages/sh_scrapy/", line 111, in _run_scrapy
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 148, in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 243, in __init__
    super(CrawlerProcess, self).__init__(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 134, in __init__
    self.spider_loader = _get_spider_loader(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 330, in _get_spider_loader
    return loader_cls.from_settings(settings.frozencopy())
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 61, in from_settings
    return cls(settings)
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 25, in __init__
  File "/usr/local/lib/python2.7/site-packages/scrapy/", line 47, in _load_all_spiders
    for module in walk_modules(name):
  File "/usr/local/lib/python2.7/site-packages/scrapy/utils/", line 71, in walk_modules
    submod = import_module(fullpath)
  File "/usr/local/lib/python2.7/importlib/", line 37, in import_module
  File "/tmp/unpacked-eggs/__main__.egg/scrapers/spiders/camping/", line 8, in <module>
    from urllib.parse import urljoin

 I reinstall shub in a virtual environment with python3 installed but it still compiles with python 2 code. How do I fix this?

1 Comment

1 person likes this
Login to post a comment