-
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
Python 3.1x from Conda environment sometimes detected as 3.1 #23649
Comments
Exactly the same problem. I have as well problems with the debugger which requires at least version 3.7 .
|
potential fix for microsoft#23649
Having the same issue, any updates on this? |
Please try the pre-release version of the python extension. It has a potential fix for this. |
Thanks, it works |
I had the same issue and fixed it following your advice. What was the cause of error? @karthiknadig |
Sorry for the dumb question, but what does this mean exactly? Is it within the VsCode settings, or update the virtual env? |
See the "Switch to pre-release version" button |
potential fix for microsoft#23649
I think this is caused because conda creates a symlink called python3.1 pointing to python3.10, python3.11 or python3.12 (whichever version you installed) for Python >=3.10. See: conda/conda#11423 (comment) |
Type: Bug
Behaviour
When the Python extension loads, it often detects Python 3.11 as Python 3.1.
As originally reported by @niemiaszek in #22968 (comment),
My suspicion is that this has to do with the symlink
python3.1 -> python3.1X
present in Conda environments.Here's what I see:
And here's my Jupyter log output, which doesn't seem particularly informative:
What really tipped me off was the output from the Ruff extension since their logs are very targeted:
EXPAND FOR PYTHON LOG EXCERPTS
I have to be really careful here about leaking sensitive info since these logs include full environment variable dumps.
Steps to reproduce:
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.8.1
VS Code version: Code 1.90.1 (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:02:43.666Z)
OS version: Linux x64 5.15.0-107-generic
Modes:
Remote OS version: Linux x64 5.15.0-107-generic
python.languageServer
setting: PylanceUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
The text was updated successfully, but these errors were encountered: