Skip to content

The terminal process failed to launch: Starting directory does not exist. #14418

@FenryrMKIII

Description

@FenryrMKIII

Environment data

  • VS Code version: 1.50.0
  • Extension version (available under the Extensions sidebar): v2020.9.114305
  • OS and version: Windows NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: NA
  • Relevant/affected Python-related VS Code extensions and their versions: NA
  • Value of the python.languageServer setting: Pylance

Expected behaviour

Should execute the script

Actual behaviour

Raise an error that the cwd directory does not exist.

Steps to reproduce:

Steps to Reproduce:

  1. Create a structure like this one :
/
   /src
      /myApp
          __init.py__
         run.py
  1. in run.py put a very simple Python code :
if __name__ == '__main__':
    print("hello")
  1. Create a Python debug configuration to launch the run.py file
{
    // 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": [
        {   
            "console": "integratedTerminal",
            "name": "Launch",
            "type": "python",
            "request": "launch",
            "cwd": "src",
            "module": "myApp.run", 
            "showLog": true,
            "trace": "verbose",
        }
    ]
}
  1. Hit the Start debugging button
  2. You shall get the error indicated in the title that the src directory does not exist
  3. Weirdly, after executing run.py itself as a script with the default debug configuration of vscode, I then ran again the other debug configuration (the problematic one) and it does not warn me about the src directory not existing. Is this expected behaviour ?

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions