diff --git a/resources/python/launcher.py b/resources/python/launcher.py index 91aa8d77ce..1ba71908d2 100644 --- a/resources/python/launcher.py +++ b/resources/python/launcher.py @@ -14,7 +14,7 @@ if adapterHost.isnumeric(): args[0] = 'host.docker.internal:' + adapterHost -dockerExecArgs = [containerExePath, 'exec', '-d', containerId, 'python', '/debugpy/launcher'] + args +dockerExecArgs = [containerExePath, 'exec', '-d', containerId, 'python3', '/debugpy/launcher'] + args command = ' '.join(dockerExecArgs) diff --git a/src/debugging/python/PythonDebugHelper.ts b/src/debugging/python/PythonDebugHelper.ts index 240f5d3321..430f2f00d1 100644 --- a/src/debugging/python/PythonDebugHelper.ts +++ b/src/debugging/python/PythonDebugHelper.ts @@ -113,12 +113,13 @@ export class PythonDebugHelper implements DebugHelper { // debugLauncherPython controls the interpreter used by the debug adapter to start the launcher, also on the local client // We want it to use what it would normally use for local Python debugging, i.e. the chosen local interpreter - // This actually launches our launcher in resources/python/launcher.py, which uses `docker exec -d python /debugpy/launcher ...` to launch the real debugpy launcher in the container + // This actually launches our launcher in resources/python/launcher.py, which uses `docker exec -d python3 /debugpy/launcher ...` to launch the real debugpy launcher in the container debugLauncherPython: '${command:python.interpreterPath}', /* eslint-enable no-template-curly-in-string */ // python controls the interpreter used by the launcher to start the application itself - python: 'python', + // Since this is in the container it should always use `python3` + python: 'python3', }; } diff --git a/src/tasks/python/PythonTaskHelper.ts b/src/tasks/python/PythonTaskHelper.ts index 48639056fe..5dbd3eff88 100644 --- a/src/tasks/python/PythonTaskHelper.ts +++ b/src/tasks/python/PythonTaskHelper.ts @@ -117,8 +117,8 @@ export class PythonTaskHelper implements TaskHelper { // User input is honored in all of the below. runOptions.volumes = this.inferVolumes(runOptions, launcherFolder); - // If the user specifies command, we won't set entrypoint; otherwise if they set entrypoint we will respect it; otherwise use 'python' to start an idle container - runOptions.entrypoint = runOptions.command ? undefined : runOptions.entrypoint || 'python'; + // If the user specifies command, we won't set entrypoint; otherwise if they set entrypoint we will respect it; otherwise use 'python3' to start an idle container + runOptions.entrypoint = runOptions.command ? undefined : runOptions.entrypoint || 'python3'; return runOptions; }