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
When starting Visual Studio Code from the terminal with a conda environment activated does say that environment is selected in the status bar (and with the 'run' button, scripts run using that environment's interpreter) but that environment is not activated in the terminal.
Steps to reproduce:
Open a terminal and activate an environment:
conda activate my_env
Start Visual Studio Code:
code .
See that that my_env is active, according to the statusbar.
See that pressing the run button does run a Python script using my_env's Python interpreter.
Open an integrated terminal.
See that the prompt gives no indication my_env is activated.
Run:
conda info
and see that only the base environment is activated.
Alternatively, start VS Code from a fresh terminal using:
conda run -n my_env code .
with the same results.
Diagnostic data
NOTE: the environment I tested with was actually called cli-board-manager. Sorry about that.
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-06-07 15:43:46.313 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-06-07 15:43:46.313 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-06-07 15:43:46.313 [info] Experiment 'pythonTestAdapter' is active
2024-06-07 15:43:46.345 [info] Default formatter is set to null for workspace /Users/david/tmp/test-code-env
2024-06-07 15:43:46.352 [info] Test server listening.
2024-06-07 15:43:46.352 [info] VS Code was launched from an activated environment: 'cli-board-manager', selecting it as the interpreter for workspace.
2024-06-07 15:43:46.352 [info] Python interpreter path: /opt/homebrew/Caskroom/miniconda/base/envs/cli-board-manager/bin/python
2024-06-07 15:43:46.363 [info] > pyenv which python
2024-06-07 15:43:46.363 [info] cwd: .
2024-06-07 15:43:46.492 [info] > conda info --json
2024-06-07 15:43:46.492 [info] shell: zsh
2024-06-07 15:43:46.897 [info] > conda run -n cli-board-manager --no-capture-output python ~/.vscode-insiders/extensions/ms-python.python-2024.4.1/python_files/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2024.4.1/python_files/printEnvVariables.py
2024-06-07 15:43:46.897 [info] shell: zsh
2024-06-07 15:43:47.313 [info] Starting Pylance language server.
2024-06-07 15:43:47.315 [info] > /opt/homebrew/bin/python3.12 ~/.vscode-insiders/extensions/ms-python.python-2024.4.1/python_files/printEnvVariables.py
2024-06-07 15:43:47.315 [info] shell: zsh
2024-06-07 15:43:47.361 [info] Setting environment variable CONDA_SHLVL in collection to 4 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.361 [info] Setting environment variable CONDA_PROMPT_MODIFIER in collection to {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Setting environment variable _CE_CONDA in collection to {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Setting environment variable CONDA_PREFIX_3 in collection to /opt/homebrew/Caskroom/miniconda/base {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Setting environment variable CONDA_PREFIX_2 in collection to /opt/homebrew/Caskroom/miniconda/base/envs/cli-board-manager {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Setting environment variable _CE_M in collection to {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Setting environment variable XPC_SERVICE_NAME in collection to 0 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-06-07 15:43:47.362 [info] Send text to terminal: /opt/homebrew/bin/python3.12 /Users/david/.vscode-insiders/extensions/ms-python.python-2024.4.1/python_files/printEnvVariablesToFile.py /Users/david/.vscode-insiders/extensions/ms-python.python-2024.4.1/python_files/deactivate/zsh/envVars.txt
2024-06-07 15:43:52.355 [info] > conda info --json
Output for Python Debugger in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python Debugger)
2024-06-07 15:43:46.494 [info] Name: Python Debugger
2024-06-07 15:43:46.494 [info] Module: debugpy
2024-06-07 15:43:46.494 [error] sendDebugpySuccessActivationTelemetry() failed. [Error: Extension 'ms-python.debugpy' CANNOT use API proposal: debugVisualization.
Its package.json#enabledApiProposals-property declares: portsAttributes, contribIssueReporter but NOT debugVisualization.
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ms-python.debugpy
at E (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:50959)
at Object.registerDebugVisualizationTreeProvider (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:162:43818)
at t.registerDebugger (/Users/david/.vscode-insiders/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/dist/extension.js:2:880949)
at e.activate (/Users/david/.vscode-insiders/extensions/ms-python.debugpy-2024.6.0-darwin-arm64/dist/extension.js:2:1128292)
at W.jb (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:158:13382)
at W.ib (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:158:13092)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:158:11114
at async c.n (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:142:6231)
at async c.m (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:142:6194)
at async c.l (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:142:5651)]
Extension version: 2024.4.1
VS Code version: Code - Insiders 1.88.0-insider (Universal) (be210b3a60c7d60030c1d3d92da00d008edf6ab9, 2024-03-15T05:49:14.505Z)
OS version: Darwin arm64 23.5.0
Modes:
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
I disabled both settings and tried both variations of "inherit env". Whenever I run VS Code from an activated environment, only the base environment is activated in the integrated terminals. So, unfortunately, this did not work.
Type: Bug
Behaviour
When starting Visual Studio Code from the terminal with a conda environment activated does say that environment is selected in the status bar (and with the 'run' button, scripts run using that environment's interpreter) but that environment is not activated in the terminal.
Steps to reproduce:
conda activate my_env
code .
my_env
is active, according to the statusbar.my_env
's Python interpreter.my_env
is activated.conda info
and see that only the
base
environment is activated.Alternatively, start VS Code from a fresh terminal using:
conda run -n my_env code .
with the same results.
Diagnostic data
NOTE: the environment I tested with was actually called
cli-board-manager
. Sorry about that.Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)Extension version: 2024.4.1
VS Code version: Code - Insiders 1.88.0-insider (Universal) (be210b3a60c7d60030c1d3d92da00d008edf6ab9, 2024-03-15T05:49:14.505Z)
OS version: Darwin arm64 23.5.0
Modes:
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
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: