Skip to content

conda env can not be autoactivated #24637

@SESProMax

Description

@SESProMax

Type: Bug

linux Ubuntu or fedora, default setting.
from python log, we can know python tool have not correctly handle the conda env path "./.conda":

###
conda run -n .conda --no-capture-output python ~/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/printEnvVariables.py
2024-12-18 22:15:36.443 [info] shell: bash
2024-12-18 22:15:37.130 [error] getActivatedEnvironmentVariables [Error: Command failed: conda run -n .conda --no-capture-output python /home/bat/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/get_output_via_markers.py /home/bat/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/printEnvVariables.py

EnvironmentLocationNotFound: Not a conda environment: /home/bat/miniconda3/envs/.conda


	at genericNodeError (node:internal/errors:984:15)
	at wrappedFn (node:internal/errors:538:14)
	at ChildProcess.exithandler (node:child_process:423:12)
	at ChildProcess.emit (node:events:530:35)
	at maybeClose (node:internal/child_process:1104:16)
	at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'conda run -n .conda --no-capture-output python /home/bat/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/get_output_via_markers.py /home/bat/.vscode/extensions/ms-python.python-2024.22.0-linux-x64/python_files/printEnvVariables.py'
}
###

I have try to turn on or off terminal.integrated.inheritEnv, that will change the base path between "/" and "/miniconda3/envs/", but both of them were incorrect.

Extension version: 2024.22.0
VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Linux x64 6.8.0-51-generic
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.11
  • 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
开发容器 ms-vscode-remote.remote-containers 0.394.0
C/C++ ms-vscode.cpptools 1.22.11
Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code MS-CEINTL.vscode-language-pack-zh-hans 1.96.2024121109
JavaScript Debugger ms-vscode.js-debug 1.96.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Pylance ms-python.vscode-pylance 2024.12.1
Python ms-python.python 2024.22.0
Python Debugger ms-python.debugpy 2024.14.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 3300)
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 2, 1, 1
Memory (System) 7.60GB (3.68GB free)
Process Argv --crash-reporter-id 663d0b4e-cd70-4d7e-919f-c2e2d648c154
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
2f103344:31071589
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions