Skip to content
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

Multiple environments getting selected #24667

Open
lindsayfowler opened this issue Dec 31, 2024 · 4 comments
Open

Multiple environments getting selected #24667

lindsayfowler opened this issue Dec 31, 2024 · 4 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@lindsayfowler
Copy link

Type: Bug

Behaviour

Multiple environments shown in the built in terminal:
(.venv) (spaghetti) (base) lf@lfs-Macbook-Air openAIgym %

Steps to reproduce:

  1. On Mac OS, press CMD+Shift+P
  2. Create .venv environment.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Darwin arm64 23.4.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.2
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Jedi"

terminal
• activateEnvironment: false

Installed Extensions
Extension Name Extension Id Version
Azure Repos ms-vscode.azure-repos 0.40.0
C/C++ ms-vscode.cpptools 1.22.11
C/C++ Extension Pack ms-vscode.cpptools-extension-pack 1.3.0
C/C++ Themes ms-vscode.cpptools-themes 2.0.0
CMake twxs.cmake 0.0.17
CMake Tools ms-vscode.cmake-tools 1.19.52
Dev Containers ms-vscode-remote.remote-containers 0.394.0
Docker ms-azuretools.vscode-docker 1.29.3
G-Code vscode-gcode.gcode 0.2.1
GitHub Repositories GitHub.remotehub 0.64.0
GitLens — Git supercharged eamodio.gitlens 16.1.1
isort ms-python.isort 2023.10.1
JavaScript Debugger ms-vscode.js-debug 1.96.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Jupyter ms-toolsai.jupyter 2024.11.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.21
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Live Preview ms-vscode.live-server 0.4.15
Python ms-python.python 2024.22.1
Python Debugger ms-python.debugpy 2024.14.0
Python Test Explorer for Visual Studio Code littlefoxteam.vscode-python-test-adapter 0.8.2
Remote Repositories ms-vscode.remote-repositories 0.42.0
Shades of Purple ahmadawais.shades-of-purple 7.3.2
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
Test Adapter Converter ms-vscode.test-adapter-converter 0.2.1
Test Explorer UI hbenl.vscode-test-explorer 2.22.1
vscode-chat-gpt ikasann-self.vscode-chat-gpt 1.2.0
System Info
Item Value
CPUs Apple M2 (8 x 2400)
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) 2, 2, 2
Memory (System) 16.00GB (0.04GB free)
Process Argv --crash-reporter-id 3b1746c5-aa93-40dc-a9f4-944ccacba670
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551:31179978
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 31, 2024
@lindsayfowler
Copy link
Author

Workaround noted on stack overflow:

Turn off "Activate Python Environment in all Terminals created" setting in the Python extension configuration in VSCode.
https://stackoverflow.com/questions/77410905/visual-studio-code-terminal-shows-multiple-conda-envs

It's a bug because why and how in the heavens can you have three environments selected at once?

@karthiknadig
Copy link
Member

@lindsayfowler This can happen if VS Code was launched from an activated terminal. The logs for python should provide details on what it used to activate. I think for you scenario if you turn of this experiment, it should behave better:

    "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]

@karthiknadig karthiknadig self-assigned this Jan 7, 2025
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jan 7, 2025
@lindsayfowler
Copy link
Author

Right... and is this string entered in the Terminal or the Command Pallette?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jan 8, 2025
@karthiknadig
Copy link
Member

You would put that in settings, User settings.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants