-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Type: Bug
Behaviour
After selecting a custom python interpreter (e.g. one provided by a conda environment) in the Command Palette, running which python3 in the integrated terminal still gives the system interpreter /usr/bin/python3.
Steps to reproduce:
Select a custom python interpreter (e.g. one provided by a conda environment) in the Command Palette, then open the integrated terminal and run:
(myenv) [yusenh@babel]$ which python3
/usr/bin/python3
(myenv) [yusenh@babel]$ echo $PATH
/home/yusenh/miniconda3/envs/myenv/bin\x3a/home/yusenh/miniconda3/envs/myenv/bin:/home/yusenh/.vscode
-server/cli/servers/Stable-19e0f9e681ecb8e5c09d8784acaa601316ca4571/server/bin/remote-cli:/home/yusen
h/miniconda3/condabin:/home/yusenh/.local/bin:/home/yusenh/bin:/usr/share/Modules/bin:/usr/local/bin:
/usr/bin:/usr/local/sbin:/usr/sbin-
I think the "\x3a" is the HTML escape code for the colon
:symbol? But it somehow it wasn't properly "un-escaped" and ended up as the raw "\x3a" sequence in the PATH string intead of the actual:symbol. Obviously the shell just interprets/home/yusenh/miniconda3/envs/myenv/bin\x3a/home/yusenh/miniconda3/envs/myenv/binas a single (nonexistent) path, and thus cannot find the correctpython3executable. -
Why is the conda path duplicated in $PATH anyways? I remember seeing this problem as early as 2023. Back then I tried to resolve this but never got an answer. I already configured conda to not auto-activate anything, so that shouldn't be causing any interference.
Diagnostic data
Output for Python in the Output panel (ViewβOutput, change the drop-down the upper-right of the Output panel to Python)
2025-05-10 17:02:09.359 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-05-10 17:02:09.359 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-05-10 17:02:09.359 [warning] Dir "/compute/babel-3-5/yusenh/LDiT/.pixi/envs" is not watchable (directory does not exist)
2025-05-10 17:02:09.442 [info] Starting Environment refresh
2025-05-10 17:02:09.442 [info] Searching for interpreters in posix paths locator
2025-05-10 17:02:09.448 [info] Searching for pyenv environments
2025-05-10 17:02:09.448 [info] Searching for conda environments
2025-05-10 17:02:09.448 [info] Searching for global virtual environments
2025-05-10 17:02:09.448 [info] Searching for custom virtual environments
2025-05-10 17:02:09.487 [info] pyenv is not installed
2025-05-10 17:02:09.487 [info] Finished searching for pyenv environments: 44 milliseconds
2025-05-10 17:02:09.488 [info] Finished searching for custom virtual envs: 44 milliseconds
2025-05-10 17:02:09.493 [info] > conda info --json
2025-05-10 17:02:09.497 [info] > hatch env show --json
2025-05-10 17:02:09.497 [info] cwd: .
2025-05-10 17:02:09.500 [info] > pyenv which python
2025-05-10 17:02:09.500 [info] cwd: .
2025-05-10 17:02:09.574 [info] > pyenv which python
2025-05-10 17:02:09.574 [info] cwd: .
2025-05-10 17:02:09.575 [info] Finished searching for global virtual envs: 131 milliseconds
2025-05-10 17:02:10.369 [info] Found: /bin/python3 --> /bin/python3.9
2025-05-10 17:02:10.370 [info] Found: /bin/python3.12 --> /bin/python3.12
2025-05-10 17:02:10.372 [info] Found: /bin/python3.9 --> /bin/python3.9
2025-05-10 17:02:10.709 [info] > ~/.pixi/bin/pixi info --json
2025-05-10 17:02:10.709 [info] cwd: .
2025-05-10 17:02:11.028 [info] Found: /usr/bin/python3 --> /usr/bin/python3.9
2025-05-10 17:02:11.029 [info] Found: /usr/bin/python3.12 --> /usr/bin/python3.12
2025-05-10 17:02:11.030 [info] Found: /usr/bin/python3.9 --> /usr/bin/python3.9
2025-05-10 17:02:11.039 [info] > ~/miniconda3/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.049 [info] > ~/miniconda3/envs/ldit/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.059 [info] Finished searching for conda environments: 1616 milliseconds
2025-05-10 17:02:11.141 [info] > ~/miniconda3/envs/lexa-repro/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.146 [info] > ~/miniconda3/envs/myenv/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.477 [info] > ~/miniconda3/envs/torch-lexa-new-env/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.481 [info] > ~/miniconda3/envs/vlrh/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.556 [info] > /bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.568 [info] > /bin/python3.12 -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.581 [info] Finished searching for interpreters in posix paths locator: 2139 milliseconds
2025-05-10 17:02:11.587 [info] Environments refresh paths discovered (event): 2145 milliseconds
2025-05-10 17:02:11.587 [info] Environments refresh paths discovered: 2146 milliseconds
2025-05-10 17:02:11.612 [info] > /usr/bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.619 [info] > /usr/bin/python3.12 -I ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/interpreterInfo.py
2025-05-10 17:02:11.698 [info] Environments refresh finished (event): 2257 milliseconds
2025-05-10 17:02:11.713 [info] Environment refresh took 2272 milliseconds
2025-05-10 17:02:11.930 [info] Python interpreter path: /bin/python3.12
2025-05-10 17:02:14.319 [info] Starting Pylance language server.
2025-05-10 17:02:18.159 [info] Active interpreter [/compute/babel-3-5/yusenh/LDiT]: /home/yusenh/miniconda3/envs/myenv/bin/python
2025-05-10 17:02:18.161 [info] Discover tests for workspace name: LDiT - uri: /compute/babel-3-5/yusenh/LDiT
2025-05-10 17:02:18.168 [info] > conda info --json
2025-05-10 17:02:18.168 [info] shell: bash
2025-05-10 17:02:18.169 [info] Python interpreter path: ~/miniconda3/envs/myenv/bin/python
2025-05-10 17:02:19.136 [info] > conda run -p ~/miniconda3/envs/myenv --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/printEnvVariables.py
2025-05-10 17:02:19.137 [info] shell: bash
2025-05-10 17:02:21.017 [info] > /bin/python3 ~/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/printEnvVariables.py
2025-05-10 17:02:21.017 [info] shell: bash
2025-05-10 17:02:21.122 [info] Setting environment variable CONDA_ROOT in collection to /home/yusenh/miniconda3 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.122 [info] Setting environment variable CONDA_PREFIX in collection to /home/yusenh/miniconda3/envs/myenv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.122 [info] Setting environment variable CONDA_PROMPT_MODIFIER in collection to (myenv) {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.122 [info] Setting environment variable CONDA_SHLVL in collection to 1 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.122 [info] Setting environment variable CONDA_DEFAULT_ENV in collection to myenv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.123 [info] Prepending environment variable PATH in collection with /home/yusenh/miniconda3/envs/myenv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-05-10 17:02:21.123 [info] Prepending environment variable PS1 in collection with (myenv) {"applyAtShellIntegration":true,"applyAtProcessCreation":false}
2025-05-10 17:02:21.123 [info] Send text to terminal: /bin/python3 /home/yusenh/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/printEnvVariablesToFile.py /home/yusenh/.vscode-server/extensions/ms-python.python-2025.6.0-linux-x64/python_files/deactivate/bash/envVars.txt
Extension version: 2025.6.0
VS Code version: Code 1.100.0 (19e0f9e681ecb8e5c09d8784acaa601316ca4571, 2025-05-07T12:48:53.763Z)
OS version: Darwin x64 23.3.0
Modes:
Remote OS version: Linux x64 5.14.0-427.40.1.el9_4.x86_64
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.16
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
- Value of the
python.languageServersetting: Default
User Settings
languageServer: "Pylance"
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| copilot | Git | 1.317.0 |
| copilot-chat | Git | 0.27.0 |
| debugpy | ms- | 2025.8.0 |
| even-better-toml | tam | 0.21.2 |
| js-debug | ms- | 1.100.0 |
| jupyter | ms- | 2025.4.0 |
| jupyter-renderers | ms- | 1.1.0 |
| markdown-preview-enhanced | shd | 0.8.18 |
| python | ms- | 2025.6.0 |
| ruff | cha | 2025.22.0 |
| tensorboard | ms- | 2023.10.1002992421 |
| vscode-js-profile-table | ms- | 1.0.10 |
| vscode-jupyter-cell-tags | ms- | 0.1.9 |
| vscode-jupyter-slideshow | ms- | 0.1.6 |
| vscode-language-pack-zh-hans | MS- | 1.100.2025050709 |
| vscode-pylance | ms- | 2025.4.1 |
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (8 x 2000) |
| 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 webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | 6, 5, 4 |
| Memory (System) | 16.00GB (0.05GB free) |
| Process Argv | --crash-reporter-id 7575e86b-e434-484d-8645-89363df807c7 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | SSH: babel-compute |
| OS | Linux x64 5.14.0-427.40.1.el9_4.x86_64 |
| CPUs | AMD EPYC 7763 64-Core Processor (256 x 2450) |
| Memory (System) | 1007.17GB (973.55GB free) |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
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
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
31787653:31262186
3e8i5726:31271747
996jf627:31283433
pythonrdcb7cf:31303019
usemplatestapi:31297334
7bj51361:31289155
747dc170:31275177
g20af354:31278749
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004