Closed scaomath closed 3 months ago
I can reproduce this with conda and python 3.12. For me, the base env and most other envs are unaffected and shows the correct python version. After repeated testing I found that the issue would occur if the conda package python-tzdata
was installed in that env.
To reproduce:
Create a new conda environment with python 3.12 and python-tzdata
mamba create --name test python=3.12 python-tzdata
You can see that the 'test' environment shows version 3.1.x
Destroy and recreate the environment with python 3.12 only
conda remove -n test --all
mamba create --name test python=3.12
Now the 'test' environment shows version 3.12.3 correctly
python.languageServer
setting: Default``` languageServer: "Pylance" ```
Other information: This is using Miniforge on Bazzite (which is based on Fedora Atomic Desktop. VS Code is installed inside an Ubuntu 22.04 distrobox.
If tzdata is the culprit as @kennethso168 suggested, then there is no way to get around it, as creating a new venv would install tzdata.
I encountered the same issue where VS Code detects Python 3.11.9 as Python 3.1.xxx. found a temporary workaround by running "Reload Window" on the command palette.
I can confirm the same issue lately with VS Code. Reloading the window seems to temporary fix it as @jinuhwang stated above.
I have the same issue
I believe this issue is related to the python3.1
symlink as generated by conda
(micromamba
in my case): https://github.com/mamba-org/mamba/issues/3317.
Similar issue here, though for me the base env (running Python 3.10.12) shows fine, but a newly created env running Python 3.11.9 intermittently shows as 3.1.x. FWIW, I do have the 3.1 symlink in there (though same is true in the base env bin folder), as well as python-tzdata 2024.1
installed in the new environment (but indeed not in the base one). Those two points were mentioned as being related to the issue at hand; seems python-tzdata
might be more explanatory in my case just like for https://github.com/microsoft/vscode-python/issues/23580#issuecomment-2156092809.
Another thing to add is that there is no such bug if one uses the old school pip .venv
, even with tzdata
installed.
Another thing to add is that there is no such bug if one uses the old school pip
.venv
, even withtzdata
installed.
Note that tzdata
and python-tzdata
are different packages; the latter is the one for which an issue arises.
I still have this issue with vscode-python 2024.8.1, vscode 1.91
This is the case for python 3.11 and python 3.10 conda environments.
Version: 1.91.0
Commit: ea1445cc7016315d0f5728f8e8b12a45dc0a7286
Datum: 2024-07-01T18:52:41.959Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
Betriebssystem: Linux x64 6.8.0-36-generic snap
Update: installing the pre-release version fixes this issue. I now have vscode-python v24.11.2024070502 installed, which works fine.
Type: Bug
Behaviour
2024.8.0 recognizes Python 3.11.9 as 3.1.x, and gives the warning message that this version is not supported. However, both local and conda venv using 3.11.9 are correctly recognized.
Downgrading to 2024.6.0 solves the problem.
Steps to reproduce:
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` XXX ```
Extension version: 2024.8.0 VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:43:07.605Z) OS version: Linux x64 5.15.0-107-generic Modes:
python.languageServer
setting: DefaultUser Settings
``` Multiroot scenario, following user settings may not apply: languageServer: "Pylance" ```
Installed Extensions
|Extension Name|Extension Id|Version| |---|---|---| |JavaScript Debugger|ms-vscode.js-debug|1.90.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.2| |Pylance|ms-python.vscode-pylance|2024.6.1| |Python|ms-python.python|2024.6.0| |Python Debugger|ms-python.debugpy|2024.6.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9|System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz (20 x 4799)| |GPU Status|2d_canvas: enabledcanvas_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| |Load (avg)|2, 2, 1| |Memory (System)|125.60GB (116.21GB free)| |Process Argv|--crash-reporter-id ac909399-c666-4e3c-a14b-b72345a6de8f| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
A/B Experiments
``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelt:31048053 dsvsc021:30996838 jg8ic977:31013176 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 pythonprt:31056678 dwnewjupytercf:31046870 fa862199:31048878 ```