-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python3.12 Unable to attach to PID (Jupyter python process) #1476
Comments
Could you enable logs using |
Unfortunately I don't see a debugpy.server*.log file. These may be relevant. debugger.vscode_24ababd2-a99b-44d7-a395-aea0bf4197c5.log For my ref: how to find log file |
Indeed, my apologies; the "logToFile" setting wouldn't be applied in this case. Instead, set the |
Thank you for the guidance. |
Hm, was there only one server log generated? Normally there should be two in this scenario - the one above is from the process that performs the injection, but the second one should be from bits of the debugger that get injected. |
There were two files created at the same time. Python 3.12 kernel.debugpy.server-6620.log Python 3.11 kernel.Similar log files (with same prefix) are generated when successfully connecting. |
I switched to using a system environment variable instead of using WinPython to add the variable and now get three files: debugpy.adapter-4172.log |
As another hint, the console in which Jupyter is running emits the following message: Python version unknown!
Error when injecting code in target process. Error code (on windows): 5 |
I ran into the same error. Tried with the process being just python.exe too; same thing.
debugpy.adapter-22480.log I'm guessing it's ending up here. |
Seems like Python 3.12 isn't supported at the moment? GetPythonVersion returns PythonVersion_Unknown for Python 3.12 debugpy/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp Line 74 in 42853a9
|
I ran into the same error by using a simple Python script instead of a jupyter notebook. |
Any solution for this issue? I got the same error in Anaconda Prompt running python 3.12 when debug in VS Code by attach using Process Id. |
Yeah this is a known issue. Attach to a python 3.12 process doesn't work yet because of all the internal changes in 3.12 that we haven't caught up with. In the meantime, 3.11 should work. |
Thank you!
Xuwei
…On Wed, May 8, 2024 at 3:47 PM Adam Yoblick ***@***.***> wrote:
Yeah this is a known issue. Attach to a python 3.12 process doesn't work
yet because of all the internal changes in 3.12 that we haven't caught up
with. In the meantime, 3.11 should work.
—
Reply to this email directly, view it on GitHub
<#1476 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVYMA2F26BVAMYSXRZOYRR3ZBKTQDAVCNFSM6AAAAABAFKZ2A2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGYZDGMRSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This issue should be fixed in the latest build of debugpy. It should ship with VS code in a future version of the Python Debugger Extension or you can install your own debugpy from pypi |
With VScode I normally debug IpyWidgets by attaching to a Jupyter Kenrnel using PID. With python 3.11 this works with an external Jupyter kernel or one managed by VScode.
Switching to using Python 3.12 it no longer connects to the PID. The only indication is a message in the console Python:....
Stops counting at 2.00s.
With Python 3.11 it counts up to about 8s then connects.
Environment data
Version: 1.84.2
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045
Actual behavior
Expected behavior
Steps to reproduce:
Launch settings
The text was updated successfully, but these errors were encountered: