You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Selecting a conda env as the default interpreter of a python project enables it, but after a day or two, the selected environment turns to "base".
Hovering the shell tab shows the correct path of the env, but for some reason the prompt shows "base" is activated.
which python also returns the unexpected path.
Also in the drop down menu selecting the python env, the name of the env with the currect path disaplys "base".
Clicking "Show Environment Contribution" opens the editor and displays wrong paths and names for the conda env.
Currently the only resolution for me is to recreate the env untill next time it happens.
Steps to reproduce:
(Working on remote ssh)
Create a conda env using conda create -n hello-world python=3.10.
Select it in a pyton project.
Wait a while (probably something unwanted happens).
Open a new shell and all of the above explained unexpected is now shown.
A notification pops up every time I open a new shell with this message: "Selected conda environment was successfully activated, even though "(base)" indicator may not be present in the terminal prompt. Learn more."
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-01-06 11:04:24.496 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-01-06 11:04:24.496 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-01-06 11:04:24.496 [info] Experiment 'pythonTestAdapter' is active
2025-01-06 11:04:24.496 [info] Native locator: Refresh started
2025-01-06 11:04:24.496 [info] Native locator: Refresh started
2025-01-06 11:04:25.678 [info] > pyenv which python
2025-01-06 11:04:25.679 [info] cwd: .
2025-01-06 11:04:26.340 [info] > conda info --json
2025-01-06 11:04:26.902 [info] Conda environment manager found at: /usr/local/conda/bin/conda
2025-01-06 11:04:26.940 [info] Conda environment manager found at: /opt/mepy37/bin/conda
2025-01-06 11:04:26.944 [info] Conda environment manager found at: /home/********/yonatanr/.conda/envs/hello-world/bin/conda
2025-01-06 11:04:26.953 [info] Python interpreter path: /home/********/yonatanr/.conda/envs/hello-world/bin/python
2025-01-06 11:04:27.115 [info] > conda info --json
2025-01-06 11:04:27.115 [info] shell: zsh
2025-01-06 11:04:27.521 [info] Native locator: Refresh finished in 4099 ms
2025-01-06 11:04:27.815 [info] > conda run -n base --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/printEnvVariables.py
2025-01-06 11:04:27.815 [info] shell: zsh
2025-01-06 11:04:28.580 [info] > python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/printEnvVariables.py
2025-01-06 11:04:28.580 [info] shell: zsh
2025-01-06 11:04:28.603 [info] Setting environment variable XML_CATALOG_FILES in collection to file:///usr/local/conda/etc/xml/catalog file:///etc/xml/catalog {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.603 [info] Setting environment variable CONDA_ROOT in collection to /usr/local/conda {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.603 [info] Setting environment variable CONDA_PREFIX in collection to /usr/local/conda {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.604 [info] Setting environment variable CONDA_PROMPT_MODIFIER in collection to (base) {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.604 [info] Setting environment variable CONDA_SHLVL in collection to 1 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.604 [info] Setting environment variable CONDA_DEFAULT_ENV in collection to base {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.604 [info] Prepending environment variable PATH in collection with /usr/local/conda/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-06 11:04:28.604 [info] Send text to terminal: python /homes/yonatanr/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/printEnvVariablesToFile.py /homes/yonatanr/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/deactivate/zsh/envVars.txt
2025-01-06 11:04:37.702 [info] Starting Pylance language server.
Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.0-88-generic
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.languageServer setting: Default
EDIT:
I think it is somehow related to the fact I have a conda bin installed in the hello-world env. It was installed as a dependency of the conda-build package I installed there.
The text was updated successfully, but these errors were encountered:
@yonaroz You identified the issue correctly. This occuress due to nested conda. Workaround is to use python.locator as js. The native locator is a new locator that we are switching to, it seems to detect environments that have conda in it as base
Type: Bug
Behaviour
which python
also returns the unexpected path.Steps to reproduce:
(Working on remote ssh)
conda create -n hello-world python=3.10
.Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.0-88-generic
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
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
A/B Experiments
EDIT:
I think it is somehow related to the fact I have a
conda
bin installed in thehello-world
env. It was installed as a dependency of theconda-build
package I installed there.The text was updated successfully, but these errors were encountered: