Skip to content
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

2024.8.0 cannot recognize the Python version in conda base env #23580

Closed
scaomath opened this issue Jun 8, 2024 · 11 comments · Fixed by #23596
Closed

2024.8.0 cannot recognize the Python version in conda base env #23580

scaomath opened this issue Jun 8, 2024 · 11 comments · Fixed by #23596
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@scaomath
Copy link

scaomath commented Jun 8, 2024

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:

  1. Create a new profile that is free of all extension.
  2. Either use command palette or look at the bottom right corner of the Python version (if the original workspace setting is using the base conda, and the Python version is 3.11.9), the version becomes 3.1.x.
  3. Downgrading to 2024.6.0 this problem is gone.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

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 version (& distribution if applicable, e.g. Anaconda): 3.11.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User 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: enabled
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
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

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jun 8, 2024
@scaomath
Copy link
Author

scaomath commented Jun 8, 2024

Screenshot from 2024-06-08 08-05-27

Screenshot from 2024-06-08 08-06-02

@kennethso168
Copy link

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

Screenshot_20240608_235745

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

Screenshot_20240608_235906

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.3
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
Ansible redhat.ansible 24.5.2
JavaScript Debugger ms-vscode.js-debug 1.90.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.2
Jupyter ms-toolsai.jupyter 2024.5.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.18
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Pylance ms-python.vscode-pylance 2024.6.1
Python ms-python.python 2024.8.0
Python Debugger ms-python.debugpy 2024.6.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
YAML redhat.vscode-yaml 1.15.0
System Info
CPUs	AMD Ryzen 5 PRO 4650G with Radeon Graphics (12 x 4167)
GPU Status	2d_canvas: enabled 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
Load (avg)	0, 0, 0
Memory (System)	30.73GB (24.72GB free)
Process Argv	--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --crash-reporter-id 7db031d7-2b48-4c62-bf40-22e7ce724e44
Screen Reader	no
VM	0%
A/B experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
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
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
showvideot:31016892
chatpanelc:31048052
dsvsc021:30996838
g316j359:31013175
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
newcmakeconfigv2:31067619
fa862199:31048878
VS Code Version details

Version: 1.90.0
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:43:07.605Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.8.11-301.fsync.fc40.x86_64

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.

@scaomath
Copy link
Author

scaomath commented Jun 9, 2024

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.

@jinuhwang
Copy link

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.

@TheWCKD
Copy link

TheWCKD commented Jun 10, 2024

I can confirm the same issue lately with VS Code. Reloading the window seems to temporary fix it as @jinuhwang stated above.

@zatkins2
Copy link

I have the same issue

@basnijholt
Copy link

I believe this issue is related to the python3.1 symlink as generated by conda (micromamba in my case): mamba-org/mamba#3317.

@torext
Copy link

torext commented Jun 11, 2024

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 #23580 (comment).

@scaomath
Copy link
Author

scaomath commented Jun 11, 2024

Another thing to add is that there is no such bug if one uses the old school pip .venv, even with tzdata installed.

@torext
Copy link

torext commented Jun 11, 2024

Another thing to add is that there is no such bug if one uses the old school pip .venv, even with tzdata installed.

Note that tzdata and python-tzdata are different packages; the latter is the one for which an issue arises.

@maurerle
Copy link

maurerle commented Jul 8, 2024

I still have this issue with vscode-python 2024.8.1, vscode 1.91

image

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants