-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"RuntimeError: already started" after VSCode Update. #12481
Comments
I have also encountered this problem, hope it can be fixed soon. |
I also came across this error after an automatic update to the extension. I tried to downgrade the extension but gave up after a few tries. My workaround is to turn off all multi-threading in my code... hope it gets fixed soon |
They are my steps to reproduce: my environment
code// try_multiprocess.py
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == '__main__':
with Pool(5) as p:
print(p.map(f, [1, 2, 3]))
errorrun by debug and get errors as below
|
Though I don't understand precisely, @int19h says as this link, And the recent commit changes around of optin and optout of So this commit will be the cause. |
This commit removes the experiment along with the old debugger, so it actually fixes this issue, in a sense. But it was only merged 3 days ago, so it's only present in insiders build, not in stable. (Consequently, if you want a quick workaround - just install insiders!) |
To work around without insiders build, please add the following to your settings.json: "python.experiments.optInto": [
"DebugAdapterFactory - experiment",
"PtvsdWheels37 - experiment"
], To be clear, this is still a bug, and the above is a temporary workaround. We're investigating the root cause. |
This should now be fixed. Can you please try restarting VSCode, and see if everything works for you now? |
Thank you @int19h At the same situation as #12481 (comment) , after restarting VSCode, the code is executed without the problem. But after finishing the program, errors |
Can you please file a separate issue at https://github.com/microsoft/debugpy ? |
I have posted a issue Thank you for your quick reply and fix @int19h ! |
Thanks! The fix was courtesy of @karthiknadig :) |
Thank you @karthiknadig ! |
Interestingly, updating my insiders version (1.47.0-insiders?) and any related extensions which had an update did not solve the issue for me. Adding the workaround suggested by @int19h into the settings.json file did solve my issue. I have multiprocessing enabled again in my code without an "already started" runtime error. Thanks :) |
@garrickbrazil Sorry, I wasn't clear - I was referring to the insiders build of the Python extension, which is orthogonal to stable/insiders build of VSCode itself. You shouldn't need it anymore, though, or anything special in settings.json - the stable version of the extension should be working correctly now out of the box. Is that not the case for you? |
@int19h You are correct. I have just removed the options for "python.experiments.optInto" from my settings.json (which solved the issue originally for me) and my multiprocessing code still works! Great, thank you! |
Looks like everybody received the fix, so I'm going to go ahead and close this. |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): XXXpython.languageServer
setting: XXXI have been using VSCode to debug Python for almost a year now with the following run configuration from my launch.json file:
After the last update, when I try to run the debugger I get the following stack trace:
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: