Closed scrovy closed 2 years ago
What does running Debugger: Show Protocol
reveal?
Apparently the debugger is having trouble finding python:
⟸ process/starting :: ['python3', 'C:\\[...]\\Sublime Text Build 3211 x64\\Data\\Packages\\Debugger/data/adapters/python/extension/pythonFiles/lib/python/debugpy/adapter']
⟸ process/started ::
⟸ request/initialize(1) :: {'clientID': 'sublime', 'clientName': 'Sublime Text', 'adapterID': 'python', 'pathFormat': 'path', 'linesStartAt1': True, 'columnsStartAt1': True, 'supportsVariableType': True, 'supportsVariablePaging': False, 'supportsRunInTerminalRequest': True, 'supportsMemoryReferences': True, 'locale': 'en-us'}
⟸ process/stderr :: P
⟸ process/stderr :: ython was not found; run without arguments to install from the Microsoft Store
⟸ process/stderr :: ,
⟸ process/stderr :: or disable this shortcut from Settings > Manage App
⟸ process/stderr :: E
⟸ process/stderr :: xecution Aliases.
⟸ process/stopped ::
But I do have the python executable in the configuration file:
"python": "C:\\[...]\\Programs\\Python\\Python310\\python.exe",
All the mentioned paths/executables exist, I've double checked it.
The adapter configuration looks at pythonPath
not python
. I see python
in the json schema though so it probably was changed to use python
instead of pythonPath
on Microsoft side.
That was it, thanks! Some config elements were wrong so hereby the (most simple) configuration that made it work:
{
"folders": [
{
"path": ".",
},
],
"debugger_configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"program": "${project_path}/main.py",
"pythonPath": "C:\\path\\to\\Python310\\python.exe"
},
],
}
Also you might need "console": "internalConsole",
if it still doesn't work.
I've installed the latest version v0.6.7 of the debugger, the python adapter and copy pasted the example under
C:\[sublime install dir]\Data\Packages\Debugger\examples\python
to a local directory calledexample_python
.With the default configuration
python.sublime-project
which comes with the example:the debugger will not start and the command log (CTRL+`) is as follows:
Changed the font setting
"font_face": "Monospace"
to"font_face": "Consolas"
in the filedebugger.sublime-settings
inside the package, and the error changes toTried all options
"console": "integratedTerminal"
,"internalConsole"
and"externalTerminal"
and all give the same error, except that now the error messageDebugger: error: Closing Debugger Console View it is not attached to a console
disappears (but stillCancelledError
occurs). (Note: the terminus package is installed, henceexternalTerminal
should also work?) Also tried a more extensive configuration filebut it didn't help. Tried to fiddle with the
open_at_startup
option ofdebugger.sublime-settings
, but with no avail. Any ideas?