I know this question has been asked in the past but none of the previous answers have helped me. I'm writing a program using Scrapy to parse some web data and, for now, store it in JSON files. My debugging for a while was working fine, but I stopped working on the project, came back to it a few weeks later, and found that I couldn't get it to stop on any of my debug points.
Here's my launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Crawl with scrapy",
"type": "python",
"request": "launch",
"module": "scrapy",
"cwd": "${workspaceFolder}/DSRCrawler/DSRCrawler/spiders",
"args": [
"crawl",
"dsrSpider",
"-a",
"start=10/1/2022",
"-a",
"end=10/2/2022",
],
"console": "internalConsole"
}
]
}
From the Debug tab in VS Code, I try hitting the Play button that appears next to "RUN AND DEBUG" in the UI and tried the "Run" menu tab and selected "Start Debugging".
I've tried deleting the launch.json file and creating it again, I've tried reinstalling VS Code. I've tried the suggestion of adding the "justMyCode": false
which doesn't seem to make a difference.
I have tried the solutions in the following links to no avail:
- Debugger Not Stopping at Breakpoints in VS Code for Python
- Why is VSCode not stopping at breakpoints for debugging?
One thing I finally found that works is using debugpy
import debugpy
...
debugpy.breakpoint()
But I'm confused why I should have to use this rather than the built in debugging and breakpoints. None of the other scrapy-specific solutions mention debugpy.