Actually, there is a very simple option to do this I found by accident while trying to edit the launch.json file.

"type": "python",
"request": "launch",
"pythonPath": "D:\\ProgramData\\Anaconda3\\envs\\simulec\\python.exe",
"module": "my_module.my_file",

Simply specify the module in the module key "module": "my_module.my_file"

The -m is not useful any more.

Answer from dzada on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › python › debugging
Python debugging in VS Code
November 3, 2021 - To generate a launch.json file with Python configurations, do the following steps: Select the create a launch.json file link (outlined in the image above) or use the Run > Open configurations menu command.
Discussions

Issues with running Python on VS Code
Were you using a venv? If I understand correctly, it's asking for the python executable so either select your system one or create a venv and select that. launch.json is for debugging, you won't need it to execute your program normally. More on reddit.com
🌐 r/learnpython
4
0
January 7, 2025
VS Code does not use launch.json arguments when I press Debug Python File
Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.63.1 OS Version: macOS Monterey 12.0.1 Steps to Reproduce: Open VS Code for Mac Open a folder containing a python fil... More on github.com
🌐 github.com
4
December 16, 2021
visual studio code - How to make VScode launch.json for a Python module - Stack Overflow
I'm researching self-supervised machine learning code. And I have wanted to debug the code with python debugger not pdb.set_trace(). This is python command for ubuntu terminal. python -m torch. More on stackoverflow.com
🌐 stackoverflow.com
VSCode / Python / Debugging / venv?
Have you selected the venv as your project interpreter? If not, ctrl+shift+p, search for interpreter and change the interpreter to the one you want. That should work I think More on reddit.com
🌐 r/learnpython
8
26
March 10, 2022
🌐
Visual Studio Code
code.visualstudio.com › docs › debugtest › debugging
Debug code with Visual Studio Code
November 3, 2021 - For simple applications, VS Code tries to run and debug the currently active file. For more complex applications or debugging scenarios, you need to create a launch.json file to specify the debugger configuration.
🌐
Visual Studio Code
code.visualstudio.com › docs › debugtest › debugging-configuration
Visual Studio Code debug configuration
November 3, 2021 - preLaunchTask - to launch a task before the start of a debug session, set this attribute to the label of a task specified in tasks.json (in the workspace's .vscode folder).
🌐
Reddit
reddit.com › r/learnpython › issues with running python on vs code
r/learnpython on Reddit: Issues with running Python on VS Code
January 7, 2025 -

So I have a data analysis script rn, no errors, and I ran it a month ago on the same pc with no errors and I can run it on google colab.
I had this issue on my laptop recently but I assumed it was only for my laptop. That wasn't the case. Essentially it asks nonstop, "Select a python interpreter" with 2 options that just go to the same file path, just one has a gear icon and the whole file path listed whereas the 2nd has only the end hal.f of the file path. Neither option changes anything, they both then bring up "Debug stopped, open 'launch.json' ".

After that it asks me for a directory, and it never works. I just try anyway I can to get to the Desktop (where my file is stored) and nothing pops up or even goes through.

Does anyone have a solution for this? Or any experience?
It just sucks how this happens out of the blue

🌐
Keploy
keploy.io › home › community › vscode python debugging tips & tricks
VSCode Python Debugging Tips & Tricks | Keploy Blog
August 25, 2025 - Master Python debugging in VSCode with breakpoints, step execution, and variable inspection to fix errors efficiently.
Find elsewhere
🌐
Medium
sanborse.medium.com › debugging-python-script-in-vscode-e865b7d6dab5
Debugging Python Script in VSCode | by Santosh Borse | Medium
September 30, 2021 - I started with simple python code file — sample-debug.py · Click on “Run and Debug” button ( on leftmost pane ) and click a link “create a launch.json file”, and select workspace of folder to save launch.json and select Python file,
🌐
GitHub
github.com › microsoft › vscode › issues › 139251
VS Code does not use launch.json arguments when I press Debug Python File · Issue #139251 · microsoft/vscode
December 16, 2021 - What is really baffling to me is nowhere in the documentation does it state the Debug Python file button does not pass arguments. Is there a way to force that button to use my launch.json? I rarely have the Run&Debug pane open so I have to do 2 extra clicks to get to this and on a Mac with my Logitech keyboard, pressing F5 requires me to move my fingers way off the middle to do Fn-F5.
Author   ejkitchen
🌐
Qodo
qodo.ai › blog › learn › tutorial: how to debug python code in visual studio code
Tutorial: How to Debug Python code in Visual Studio Code - Qodo
September 17, 2025 - VS Code’s debugger automatically uses your selected Python interpreter, but you can override this in launch.json if needed.
🌐
BytePlus
byteplus.com › en › topic › 504274
Launch JSON vscode Python
Build better products, deliver richer experiences, and accelerate growth through our wide range of intelligent solutions. Core content of this page: Launch JSON vscode Python
🌐
Visual Studio Code
code.visualstudio.com › docs › python › environments
Python environments in VS Code
November 3, 2021 - By default, the debugger uses your selected environment. To use a different interpreter for debugging, set the python property in your launch.json debug configuration.
🌐
The Chaotic Engineer
chaoticengineer.hashnode.dev › debugging-python-apps-in-vscode
Debugging Python Apps in VSCode
June 7, 2024 - Take a look at the configuration for the debug_hello app, located in the .vscode/launch.json file: { "configurations": [ { "name": "Run Server", "type": "python", "request": "launch", "module": "uvicorn", "args": [ "debug_hell.app:app", "--reload", "--host", "0.0.0.0", "--port", "8001" ], "env": { "DATABASE_URL": "postgresql+asyncpg://postgres:postgres@localhost:5432/debug_hell" }, "justMyCode": false } ] }
🌐
Python Land
python.land › home › creating python programs › python in vscode: running and debugging
Python in VSCode: Running and Debugging • Python Land Tutorial
September 5, 2025 - Modify the JSON to look like this: { "version": "0.2.0", "configurations": [ { "name": "Run with argument", "type": "python", "request": "launch", "program": "vscode_playground.py", "console": "integratedTerminal", "args": ["Erik"] } ] }Code language: JSON / JSON with Comments (json)
🌐
Medium
medium.com › @jonathan_b › debugging-in-visual-studio-code-a-python-app-with-arguments-8d75a69bbd66
Debugging in Visual Studio Code — A Python app with arguments | by BLAKELY | Medium
June 25, 2024 - To create a launch.json file, click debug and run and click the textual link, create a launch.json file . ... Select Python Debugger from the Command Palette. From the list of debug configurations that appear, select thePython file with arguments ...
🌐
Medium
m-ruminer.medium.com › vscode-and-debugging-python-in-virtual-environments-d975125b455c
VSCode and Debugging Python in Virtual Environments | by Michael Ruminer | Medium
January 10, 2026 - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: crewai series day_04", "type": "debugpy", "request": "launch", "program": "${file}", "console": "integratedTerminal", "env": { "PYTHONPATH": "${workspaceFolder}\\crewai_series" }, "cwd": "${workspaceFolder}\\crewai_series\\day_04\\src" }, { "name": "Python: crewai series day_05", "type": "debugpy", "request": "launch", "program": "${file}", "console": "integratedTerminal", "env": { "PYTHONPATH": "${workspaceFolder}\\crewai_series" }, "cwd": "${workspaceFolder}\\crewai_series\\day_05\\src" } ] }
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-debug-a-python-module-in-vscode
How to debug a python module in VSCode - GeeksforGeeks
July 23, 2025 - This configuration tells VSCode how to run and debug your code. First, open the Debug view by clicking on the debug icon in the activity bar. Then click on the gear icon to open the 'launch.json' file.
🌐
Visual Studio Code
code.visualstudio.com › docs › python › testing
Python testing in Visual Studio Code
November 3, 2021 - For example, the configuration below in the launch.json file disables the justMyCode setting for debugging tests: { "name": "Python: Debug Tests", "type": "debugpy", "request": "launch", "program": "${file}", "purpose": ["debug-test"], "console": "integratedTerminal", "justMyCode": false }
🌐
Robot Framework
forum.robotframework.org › tools › visual studio code(ium)
Configuration of VSCode (launch.json) - Visual Studio Code(ium) - Robot Framework
May 31, 2022 - We try to migrate from RED to Visual Studio Code. It seems it’s not simply done be installing the plugin (GitHub - d-biehl/robotcode: RobotFramework support for Visual Studio Code). Afterwards we need to configure the launch.json file. Because we never worked with VSCode, we haven’t a clue ...