-
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
Debugging does not work with a conda environment #18436
Comments
Having the same problem since the update to v2022.0.1786462952 |
Same over here. Worked fine yesterday. Got up to VSCode update and it no longer works. The extension seems not to be able to start the debuggee. Before it was broken, one could see the commandline passed to the pyhon interpreter in the terminal of VScode. This no longer happens. |
Also same for me. Temporarily solved by reloading python IntelliSense to version v2021.12.1559732655. |
Same for me, specifically when using a Conda environment inside a docker container. When using the System interpreter (both host's and docker container's) it works fine. Had to install 2021.12.1559732655 inside the docker container's vscode to fix it. |
++same |
++same |
Same here. This happens only with Conda environment - the other interpreters work fine. |
Is anyone not a conda user? For those that are using conda, this is probably because of https://devblogs.microsoft.com/python/python-in-visual-studio-code-february-2022-release/#improvements-when-using-anaconda . We thought we had this working but apparently there's at least some underlying issue. While we take a look to solve this please feel free to roll back to the 2020.12 release for now and subscribe to this issue to know when we have resolved the problem. |
Can some ones share how you created conda environment? Did you use Are you seeing anything in the terminal when the debugger starts? or the debugger is failing to start entirely? Is there in thing in the Output>Python logs that you can share that might help with this issue? |
Can you also share the output of |
Another thing to test with the debugger, try running this command from any terminal: If you are using VS Code server then replace If everything is setup as expected, you should see this: If you don't see that, instead you either get an error or nothing happens. That means you might have an unsupported version of |
Hey, Thanks for looking into this issue so fast! Hope I can help with that. I just noticed your new message while typing. So indeed the conda version in which the debugger is not working is below 4.9.0 |
Conda info (4.10) How the env. is created with docker RUN commands, running vscode-server inside container. The |
Could be read-only vs writable base environment. Based on two data points. |
@mlamarre That might be different issue with how the environment is set (i.e readonly). That error is coming from conda itself:
From my investigation of this issue, it seems like conda < 4.9.0 are failing. This is because those versions did not support streaming io. Which is what the debugger needs to work. |
But I'm on 4.10 and it still fails with the exact same behaviour as reported at the top of this issue and I have been using the debugger for months and it broke yesterday. |
@mlamarre the cause is different in your case, but the effect is that the debugger does not run. This was probably working before because we did not use We used to run the debugger like this. I believe if you use the path to the python binary directly to launch the debugger like below it will start:
But running it with
If you can try it out (i.e., running debugger using python from env directly), please let me know if it ran. |
@mlamarre You are running into this issue conda/conda#10690 . |
@bernardo-suez Please check your conda version, if it is below 4.9.0 update to the latest version, and see if it helps. |
same problem. |
@karthiknadig's suggestion to update Conda from 4.8 to 4.11 also worked for me: |
the same issue here, python 3.7, conda 4.7 |
Mine worked after updating conda to |
Thanks, it worked here as well after updating to conda 4.11 |
Can someone here try this build and let me know if it helps with the issue? https://github.com/microsoft/vscode-python/suites/5209242839/artifacts/159283844 We are planning a temporary fix. I still suggest that people update conda to at least 4.9.0 |
To update everyone: we have a fix merged in #18451 and cherry-picked in #18465 (basically we fall back to the old way of doing things if you're running an old version of conda that doesn't support what we need with But do note we strongly advise any of you on conda <4.9 to upgrade. The extension has been updated across the board to use |
Another workaround is to set a symbolic link to conda env's python interpreter, and add this as a 'new' python interpreter, and debug process will start to work, without conda environment activated, which could be done manually after python debug console pops up. This requires no changes in your conda environment.
I believe this is a strong indication that new launcher doesn't work with old conda. Update:
will solve environment inconsistency and repair broken conda environment (especially envs messed up by pip), and after conda update the debugger works. |
I updated conda to 4.11, but the problem has not been solved, however degrading the python extension into 2021.12.1559732655 worked with me. |
Worked for me after degrading the python extension into 2021.12.1559732655, even with |
We just published a fix for the older versions of conda. The fix is in version If you are in a newer version of conda and are experiencing issues, please check the error reported by conda here https://github.com/conda/conda/issues. |
The problem still persists for me using VS Code 1.64.1, extension version v2022.0.1814523869 and conda 4.9.1, while using it in SSH remote mode. It works correctly with v2021.12.1559732655. |
@ABotond Can you try the steps here in the terminal to see if the debugger is able to start in your environment? #18436 (comment) |
@karthiknadig Thanks for the quick answer. Indeed, the problem lies here somewhere:
Oh, and I'm using conda version 4.9.2, not 4.9.1. I'm connecting to a docker image (based on pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel) running an ssh server. I can provide a minimal Dockerfile if needed. |
Awesome job! This new version of the Python extension works for me. |
@ABotond You are running into this issue conda/conda#10690 . Please give conda directory write permissions, and it should work. Up vote the conda issue so this gets resolved by them. |
@karthiknadig what an ugly hack. But that was it, thanks a lot for your help! |
In my case, the formatter does not work, even if I upgrade conda to |
@Raphael-Hao please open a separate issue as that's not related to debugging. |
I had the same issue, and had nothing to do with the extension version, only with my Conda version. I upgraded conda from 4.10 to 4.11, and even with the latest version of VS Code Python (v2022.0.1814523869), it now works. |
Issue Type: Bug
Behaviour
While debugging Python scripts, F5 or "Play button" gives no action - the only thing I see is bar with "stop", "play" and "restart" buttons - but this bar just dissapear after few seconds. In terminal no output is printed.
Since last successful debugging session no system updates or other apps were installed, VSCode is up-to-date.
I have tried restarting VSCode and restarting computer ;)
Linked with:
microsoft/vscode#142154
Expected vs. Actual
Expected: Press F5 button runs code in debug mode.
Actual: After pressing F5 button only "debug bar" appears, but code does not run at all.
Steps to reproduce:
launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": false } ] }Diagnostic data
python.languageServer
setting: PylanceUser Settings
Extension version: 2022.0.1786462952
VS Code version: Code 1.64.0 (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:22:20.678Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: