Replies: 1 comment 4 replies
-
It looks like your code is taking too long to start up, so VS Code is timing out trying to connect to it (it's really hard to read the output, so this unfortunately a partial guess based on what I can make out). You can try following the suggestions in https://code.visualstudio.com/docs/python/debugging#_troubleshooting or start your code up in an attach situation and then have the debugger attach to it when it's already running. Otherwise if it's Jupyter-specific you can ask at https://github.com/microsoft/vscode-jupyter . |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure what change I made triggered, but I can no longer debug within a certain Conda environment, neither using the "Run and Debug" pane nor via Jupyter.
With the Debug pane, the loading bar goes halfway and nothing happens. Debug terminal also doesn't open. With debug cell in Jupyter, I get a Runtime Error message in the interactive window and the following in the Jupyter log.
As I mentioned, this only happens with one specific Conda environment. Everything else seems to be working fine within the environment. I've tried using different Python extension versions, restarting my computer, and defaulting Python extension settings, but none seemed to have worked.
Jupyter log (apologies but the nonstandard characters in the output are messing up the code block):
`error 21:34:55.129: Execute_request failure enabling debugging for IW import debugpy;debugpy.listen(('localhost', 0)) RuntimeError: timed out waiting for adapter to connect
�[0;31m---------------------------------------------------------------------------�[0m
�[0;31mtimeout�[0m Traceback (most recent call last)
File �[0;32m~/miniconda3/envs/python39_tf/lib/python3.9/site-packages/debugpy/server/api.py:218�[0m, in �[0;36mlisten�[0;34m(address, settrace_kwargs)�[0m
�[1;32m 217�[0m �[38;5;28;01mtry�[39;00m:
�[0;32m--> 218�[0m sock, _ �[38;5;241m=�[39m �[43mendpoints_listener�[49m�[38;5;241;43m.�[39;49m�[43maccept�[49m�[43m(�[49m�[43m)�[49m
�[1;32m 219�[0m �[38;5;28;01mtry�[39;00m:
�[1;32m 287�[0m �[38;5;124;03m"""accept() -> (socket object, address info)�[39;00m
�[1;32m 288�[0m
�[1;32m 289�[0m �[38;5;124;03mWait for an incoming connection. Return a new socket�[39;00m
�[1;32m 290�[0m �[38;5;124;03mrepresenting the connection, and the address of the client.�[39;00m
�[1;32m 291�[0m �[38;5;124;03mFor IP sockets, the address info is a pair (hostaddr, port).�[39;00m
�[1;32m 292�[0m �[38;5;124;03m"""�[39;00m
�[0;32m--> 293�[0m fd, addr �[38;5;241m=�[39m �[38;5;28;43mself�[39;49m�[38;5;241;43m.�[39;49m�[43m_accept�[49m�[43m(�[49m�[43m)�[49m
�[1;32m 294�[0m sock �[38;5;241m=�[39m socket(�[38;5;28mself�[39m�[38;5;241m.�[39mfamily, �[38;5;28mself�[39m�[38;5;241m.�[39mtype, �[38;5;28mself�[39m�[38;5;241m.�[39mproto, fileno�[38;5;241m=�[39mfd)
During handling of the above exception, another exception occurred:
�[0;32m----> 1�[0m �[38;5;28;01mimport�[39;00m �[38;5;21;01mdebugpy�[39;00m;�[43mdebugpy�[49m�[38;5;241;43m.�[39;49m�[43mlisten�[49m�[43m(�[49m�[43m(�[49m�[38;5;124;43m'�[39;49m�[38;5;124;43mlocalhost�[39;49m�[38;5;124;43m'�[39;49m�[43m,�[49m�[43m �[49m�[38;5;241;43m0�[39;49m�[43m)�[49m�[43m)�[49m
�[1;32m 94�[0m �[38;5;124;03m"""Starts a debug adapter debugging this process, that listens for�[39;00m
�[1;32m 95�[0m �[38;5;124;03mincoming socket connections from clients on the specified address.�[39;00m
�[1;32m 96�[0m
�[0;32m (...)�[0m
�[1;32m 108�[0m �[38;5;124;03muntil the client connects.�[39;00m
�[1;32m 109�[0m �[38;5;124;03m"""�[39;00m
�[1;32m 111�[0m �[38;5;28;01mfrom�[39;00m �[38;5;21;01mdebugpy�[39;00m�[38;5;21;01m.�[39;00m�[38;5;21;01mserver�[39;00m �[38;5;28;01mimport�[39;00m api
�[0;32m--> 113�[0m �[38;5;28;01mreturn�[39;00m �[43mapi�[49m�[38;5;241;43m.�[39;49m�[43mlisten�[49m�[43m(�[49m�[43maddress�[49m�[43m)�[49m
�[1;32m 141�[0m �[38;5;28;01mreturn�[39;00m func(address, settrace_kwargs, �[38;5;241m�[39m�[38;5;241m�[39mkwargs)
�[1;32m 142�[0m �[38;5;28;01mexcept�[39;00m �[38;5;167;01mException�[39;00m:
�[0;32m--> 143�[0m �[43mlog�[49m�[38;5;241;43m.�[39;49m�[43mreraise_exception�[49m�[43m(�[49m�[38;5;124;43m"�[39;49m�[38;5;132;43;01m{0}�[39;49;00m�[38;5;124;43m() failed:�[39;49m�[38;5;124;43m"�[39;49m�[43m,�[49m�[43m �[49m�[43mfunc�[49m�[38;5;241;43m.�[39;49m�[38;5;18;43m__name__�[39;49m�[43m,�[49m�[43m �[49m�[43mlevel�[49m�[38;5;241;43m=�[39;49m�[38;5;124;43m"�[39;49m�[38;5;124;43minfo�[39;49m�[38;5;124;43m"�[39;49m�[43m)�[49m
�[1;32m 138�[0m settrace_kwargs[�[38;5;124m"�[39m�[38;5;124mdont_trace_end_patterns�[39m�[38;5;124m"�[39m] �[38;5;241m=�[39m (�[38;5;28mstr�[39m(�[38;5;124m"�[39m�[38;5;124mdebugpy_launcher.py�[39m�[38;5;124m"�[39m),)
�[1;32m 140�[0m �[38;5;28;01mtry�[39;00m:
�[0;32m--> 141�[0m �[38;5;28;01mreturn�[39;00m �[43mfunc�[49m�[43m(�[49m�[43maddress�[49m�[43m,�[49m�[43m �[49m�[43msettrace_kwargs�[49m�[43m,�[49m�[43m �[49m�[38;5;241;43m�[39;49m�[38;5;241;43m�[39;49m�[43mkwargs�[49m�[43m)�[49m
�[1;32m 142�[0m �[38;5;28;01mexcept�[39;00m �[38;5;167;01mException�[39;00m:
�[1;32m 143�[0m log�[38;5;241m.�[39mreraise_exception(�[38;5;124m"�[39m�[38;5;132;01m{0}�[39;00m�[38;5;124m() failed:�[39m�[38;5;124m"�[39m, func�[38;5;241m.�[39m�[38;5;18m__name__�[39m, level�[38;5;241m=�[39m�[38;5;124m"�[39m�[38;5;124minfo�[39m�[38;5;124m"�[39m)
�[1;32m 228�[0m �[38;5;28;01mexcept�[39;00m socket�[38;5;241m.�[39mtimeout:
�[1;32m 229�[0m log�[38;5;241m.�[39mswallow_exception(
�[1;32m 230�[0m �[38;5;124m"�[39m�[38;5;124mTimed out waiting for adapter to connect:�[39m�[38;5;124m"�[39m, level�[38;5;241m=�[39m�[38;5;124m"�[39m�[38;5;124minfo�[39m�[38;5;124m"�[39m
�[1;32m 231�[0m )
�[0;32m--> 232�[0m �[38;5;28;01mraise�[39;00m �[38;5;167;01mRuntimeError�[39;00m(�[38;5;124m"�[39m�[38;5;124mtimed out waiting for adapter to connect�[39m�[38;5;124m"�[39m)
�[1;32m 233�[0m �[38;5;28;01mexcept�[39;00m �[38;5;167;01mException�[39;00m �[38;5;28;01mas�[39;00m exc:
�[1;32m 234�[0m log�[38;5;241m.�[39mswallow_exception(�[38;5;124m"�[39m�[38;5;124mError retrieving adapter endpoints:�[39m�[38;5;124m"�[39m, level�[38;5;241m=�[39m�[38;5;124m"�[39m�[38;5;124minfo�[39m�[38;5;124m"�[39m)
error 21:34:55.129: Error in execution (get message for cell) [o [Error]: RuntimeError
at b.connectToLocal (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1605659)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async b.connect (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1604020)
at async b.startDebugSession (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1603163)
at async z.createExecutionPromise (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1695955)] {
category: 'notinstalled',
kernelConnectionMetadata: f {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/temp/jupyter/kernels/pythonjvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13/kernel.json',
interpreterPath: '/Users/tanay/miniconda3/envs/python39_tf/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'pythonjvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13',
argv: [Array],
language: 'python',
executable: 'python',
display_name: 'python39_tf',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: {
id: '/Users/tanay/miniconda3/envs/python39_tf/bin/python',
sysPrefix: '/Users/tanay/miniconda3/envs/python39_tf',
envPath: [d],
displayPath: [d],
envName: 'python39_tf',
uri: [d],
displayName: 'python39_tf',
envType: 'Conda',
version: [Object]
},
id: '.jvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13./Users/tanay/miniconda3/envs/python39_tf/python./Users/tanay/miniconda3/envs/python39_tf/python.-m#ipykernel_launcher'
}
}
warn 21:34:55.130: DataScience Error [o [Error]: RuntimeError
at b.connectToLocal (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1605659)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async b.connect (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1604020)
at async b.startDebugSession (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1603163)
at async z.createExecutionPromise (/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/out/extension.node.js:2:1695955)] {
category: 'notinstalled',
kernelConnectionMetadata: f {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/tanay/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003412109/temp/jupyter/kernels/pythonjvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13/kernel.json',
interpreterPath: '/Users/tanay/miniconda3/envs/python39_tf/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'pythonjvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13',
argv: [Array],
language: 'python',
executable: 'python',
display_name: 'python39_tf',
metadata: [Object],
env: {},
interrupt_mode: undefined
},
interpreter: {
id: '/Users/tanay/miniconda3/envs/python39_tf/bin/python',
sysPrefix: '/Users/tanay/miniconda3/envs/python39_tf',
envPath: [d],
displayPath: [d],
envName: 'python39_tf',
uri: [d],
displayName: 'python39_tf',
envType: 'Conda',
version: [Object]
},
id: '.jvsc74a57bd09e459d461750e0ad0dd48f0512403b45939cf5739455aca8620f655ec5e30e13./Users/tanay/miniconda3/envs/python39_tf/python./Users/tanay/miniconda3/envs/python39_tf/python.-m#ipykernel_launcher'
}
}`
Beta Was this translation helpful? Give feedback.
All reactions