Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[vscode ver. 1.100] Python environment incorrectly activated #25051

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

Open
LaurentEsingle opened this issue May 10, 2025 · 3 comments
Open

[vscode ver. 1.100] Python environment incorrectly activated #25051

LaurentEsingle opened this issue May 10, 2025 · 3 comments
Assignees
Labels
area-environments Features relating to handling interpreter environments triage-needed Needs assignment to the proper sub-team

Comments

@LaurentEsingle
Copy link

LaurentEsingle commented May 10, 2025

Type: Bug

Python environment incorrectly activated

It was working fine in version 1.99

But now when I launch a new integrated terminal, I can see the usual indicator for loaded python environment (environment name between parenthesis at the start of the terminal prompt), but typing "python" in the terminal produces the following:

$ python
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3

I use pyenv to manage environments and here is how it is set up in .profile and .bashrc files:

export PYENV_ROOT="/home/wsluser/.pyenv"
command -v pyenv >/dev/null || export PATH="/home/wsluser/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/wsluser:/home/wsluser/.local/bin"
eval "$(/home/wsluser/.pyenv/bin/pyenv init -)"

Shell seems correctly set up as I compared $PATH variable in the Integrated terminal and the standalone.

It looks like pyenv settings are not applied to the integrated terminal session.

Please note the following:

  • in a standalone terminal, switching environments works well
  • it works well in version 1.99 (I have two machines. Had the issue on the first one first (Windows) with version 1.100. The second one (Mac) with version 1.99 was working fine until it was updated with 1.100)

VS Code version: Code 1.100.0 (19e0f9e681ecb8e5c09d8784acaa601316ca4571, 2025-05-07T12:48:53.763Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 6.8.0-1028-aws

System Info
Item Value
CPUs Intel(R) Core(TM) i9-14900K (32 x 3187)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.69GB (23.98GB free)
Process Argv --crash-reporter-id c20d6425-cd82-4990-9a05-2e8ffdefdf54
Screen Reader no
VM 0%
Item Value
Remote gnarativ-dev
OS Linux x64 6.8.0-1028-aws
CPUs Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (4 x 0)
Memory (System) 15.44GB (11.20GB free)
VM 0%
Extensions (37)
Extension Author (truncated) Version
vscode-tsv cte 0.2.2
remotehub Git 0.64.0
vscode-drawio hed 1.9.0
vscode-edge-devtools ms- 2.1.8
jupyter-keymap ms- 1.1.2
remote-containers ms- 0.413.0
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.99.0
vscode-remote-extensionpack ms- 0.26.0
azure-repos ms- 0.40.0
remote-explorer ms- 0.5.0
remote-repositories ms- 0.42.0
remote-server ms- 1.5.2
vscode-speech ms- 0.14.0
aws-toolkit-vscode ama 3.60.0
vscode-eslint dba 3.0.10
docker doc 0.6.0
gitlens eam 17.0.3
copilot Git 1.317.0
copilot-chat Git 0.27.0
vscode-pull-request-github Git 0.110.0
gc-excelviewer Gra 4.2.63
git-graph mhu 1.30.0
vscode-docker ms- 1.29.6
debugpy ms- 2025.8.0
python ms- 2025.6.0
vscode-pylance ms- 2025.4.1
jupyter ms- 2025.4.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
copilot-mermaid-diagram ms- 0.0.3
vscode-commander ms- 0.2.0
vscode-websearchforcopilot ms- 0.1.2025050101
yithemes wan 0.21.0

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
31787653:31262186
3e8i5726:31271747
7bh79656:31259953
996jf627:31283433
pythonrdcb7:31303018
usemplatestapi:31297334
7bj51361:31289155
747dc170:31275177
g20af354:31278749
pylancecolor:31303816
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

@LaurentEsingle
Copy link
Author

LaurentEsingle commented May 10, 2025

Update:
my current workaround is:

  • set python.terminal.activateEnvironment in vscode settings to false
  • open a new integrated terminal (python env not activated thanks to the setting above)
  • manually set the env in the terminal: pyenv activate <environment>

@mumiao2000
Copy link

same problem

@iwangbowen
Copy link

Did you wait for all python extensions to load before launch terminals

@anthonykim1 anthonykim1 transferred this issue from microsoft/vscode May 12, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label May 12, 2025
@anthonykim1 anthonykim1 added the area-environments Features relating to handling interpreter environments label May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-environments Features relating to handling interpreter environments triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

6 participants