skip to Main Content

The problem is that I can’t debug Scrapy crawlers in VS Code. The problem is that always when I start debugging it breaks on one of my imports. Of course, I played a lot with that import in order to fix it, but it didn’t helped. I also tried with venv and without venv, but it doesn’t helped.

Anyone faced the same issue?

Here is the error

2

Answers


  1. I don’t have experience with Scrapy, but if this happens in debug mode only and it run’s ok otherwise (from CLI), than most likely there is problem with your Python paths.
    Do you use Python virtual environment?

    Login or Signup to reply.
  2. This was usually caused by incorrect python interpreter.

    You could use shortcuts "Ctrl+Shift+P" and type "Python: Select Interpreter" to choose your python interperter.

    If it doesn’t work, you could set python in your launch.json.

    https://code.visualstudio.com/docs/python/debugging#_python

    The full path that points to the Python interpreter to be used for
    debugging.

    If not specified, this setting defaults to the interpreter selected
    for your workspace, which is equivalent to using the value
    ${command:python.interpreterPath}. To use a different interpreter,
    specify its path instead in the python property of a debug
    configuration.

    Alternately, you can use a custom environment variable that’s defined
    on each platform to contain the full path to the Python interpreter to
    use, so that no other folder paths are needed.

    If you need to pass arguments to the Python interpreter, you can use
    the pythonArgs property.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search