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

environment duplication -- interference with conda init #22233

Closed
dataders opened this issue Oct 16, 2023 · 4 comments
Closed

environment duplication -- interference with conda init #22233

dataders opened this issue Oct 16, 2023 · 4 comments
Assignees
Labels
experimenting Feature is part of an experiment info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@dataders
Copy link

dataders commented Oct 16, 2023

Type: Bug

Behaviour

I tried finding related issues, best I could find is #11039

Expected vs. Actual

Expected

Only one environment activates in my open Terminal when the Python extension is activated.

I'm used to having my terminal auto activate conda and my environment with text when the terminal opens. It's cool that this works the other way, but this new behavior I think goes against the recommendations of Conda? See my .zshrc, if I remove that block that conda init automatically adds, then things work as expected -- cool?

Actual

Somehow the environment (dbt) still is listed in parentheticals, but so is (base). This only happened to me a few week ago -- I've been using Code Insiders for over a year now

To get it back to what I'm used to, I must call conda deactivate twice, then conda activate dbt (See below screenshot).

image

Steps to reproduce:

  1. have an already created environment defined as Python's default interpreter (at workspace or user-level)
  2. Open .py file to trigger opening of Python extension
  3. Open terminal

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2023-10-16 14:43:48.944 [info] Experiment 'pythonPromptNewFormatterExt' is active
2023-10-16 14:43:48.944 [info] Experiment 'pythonPromptNewToolsExt' is active
2023-10-16 14:43:48.944 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2023-10-16 14:43:48.944 [info] Experiment 'pythonTestAdapter' is active
2023-10-16 14:43:48.944 [info] Test server listening.
2023-10-16 14:43:48.944 [info] Python interpreter path: /opt/homebrew/bin/python3
2023-10-16 14:43:49.466 [warning] Retry failed, storage update failed for key PYTHON_WORKSPACE_STORAGE_KEYS
2023-10-16 14:43:49.466 [warning] Retry failed, storage update failed for key PYTHON_WORKSPACE_STORAGE_KEYS
2023-10-16 14:43:49.466 [warning] Retry failed, storage update failed for key PYTHON_WORKSPACE_STORAGE_KEYS
2023-10-16 14:43:49.920 [info] > conda info --json
2023-10-16 14:43:50.777 [info] Starting Pylance language server.
2023-10-16 14:43:51.460 [info] Found: /usr/bin/python3 --> /usr/bin/python3
2023-10-16 14:43:51.468 [info] > ~/miniforge3/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.483 [info] Found: /Users/dataders/miniforge3/bin/python --> /Users/dataders/miniforge3/bin/python3.9
2023-10-16 14:43:51.484 [info] Found: /Users/dataders/miniforge3/bin/python3 --> /Users/dataders/miniforge3/bin/python3.9
2023-10-16 14:43:51.484 [info] Found: /Users/dataders/miniforge3/bin/python3.9 --> /Users/dataders/miniforge3/bin/python3.9
2023-10-16 14:43:51.488 [info] > ~/miniforge3/envs/bqdev/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.492 [info] Found: /opt/homebrew/bin/python3 --> /opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/bin/python3.11
2023-10-16 14:43:51.492 [info] Found: /opt/homebrew/bin/python3.10 --> /opt/homebrew/Cellar/[email protected]/3.10.13/Frameworks/Python.framework/Versions/3.10/bin/python3.10
2023-10-16 14:43:51.493 [info] Found: /opt/homebrew/bin/python3.11 --> /opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/bin/python3.11
2023-10-16 14:43:51.494 [info] Found: /opt/homebrew/bin/python3.8 --> /opt/homebrew/Cellar/[email protected]/3.8.16/Frameworks/Python.framework/Versions/3.8/bin/python3.8
2023-10-16 14:43:51.495 [info] Found: /opt/homebrew/bin/python3.9 --> /opt/homebrew/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/bin/python3.9
2023-10-16 14:43:51.504 [info] > ~/miniforge3/envs/dbt/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.549 [info] > ~/miniforge3/envs/dbtpy/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.709 [info] > ~/miniforge3/envs/dbxsdk/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.719 [info] > ~/miniforge3/envs/dbxsdk2/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.835 [info] > ~/miniforge3/envs/dev/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.836 [info] > ~/miniforge3/envs/dev5823/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.892 [info] > ~/miniforge3/envs/devfab/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:51.997 [info] > ~/miniforge3/envs/devmongo/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.066 [info] > ~/miniforge3/envs/devtsql/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.128 [info] > ~/miniforge3/envs/douggie/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.183 [info] > ~/miniforge3/envs/mtz/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.301 [info] > ~/miniforge3/envs/mzreprex/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.305 [info] > ~/miniforge3/envs/rs14/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.394 [info] > ~/miniforge3/envs/rs15/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.401 [info] > ~/miniforge3/envs/rsdev/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.490 [info] > ~/miniforge3/envs/snowarrow/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.519 [info] > ~/miniforge3/envs/snowdt/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.639 [info] > ~/miniforge3/envs/spotdl/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.665 [info] > ~/miniforge3/envs/testpbuf2/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.779 [info] > ~/miniforge3/envs/testpbuff/bin/python -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.806 [info] > /usr/bin/python3 -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.920 [info] > /opt/homebrew/bin/python3 -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:52.988 [info] > /opt/homebrew/bin/python3.10 -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:53.005 [info] > /opt/homebrew/bin/python3.8 -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:43:53.161 [info] > /opt/homebrew/bin/python3.9 -I ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/interpreterInfo.py
2023-10-16 14:44:05.907 [info] Python interpreter path: ~/miniforge3/envs/dbt/bin/python
2023-10-16 14:44:05.908 [info] > conda info --json
2023-10-16 14:44:05.908 [info] shell: zsh
2023-10-16 14:44:05.910 [info] > conda run -n dbt --no-capture-output python ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/printEnvVariables.py
2023-10-16 14:44:05.910 [info] shell: bash
2023-10-16 14:44:07.091 [info] > conda run -n dbt --no-capture-output python ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/get_output_via_markers.py ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/printEnvVariables.py
2023-10-16 14:44:07.091 [info] shell: zsh
2023-10-16 14:44:09.887 [info] > /usr/bin/python3 ~/.vscode-insiders/extensions/ms-python.python-2023.19.12861011/pythonFiles/printEnvVariables.py
2023-10-16 14:44:09.887 [info] shell: zsh

User Settings

Multiroot scenario, following user settings may not apply:

languageServer: "Pylance"

Extension version: 2023.19.12861011
VS Code version: Code - Insiders 1.84.0-insider (Universal) (eb4f3c149f34d82b9763a08230907cf79e7fc103, 2023-10-10T05:42:05.917Z)
OS version: Darwin arm64 22.6.0
Modes:

System Info
Item Value
CPUs Apple M1 (8 x 24)
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 6, 5, 6
Memory (System) 16.00GB (0.08GB free)
Process Argv --crash-reporter-id 48bee2e8-074d-4e7e-a76a-71ed9f62cc77
Screen Reader no
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
py29gd2263:30784851
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
showlangstatbar:30737417
57b77579:30687741
pythonfmttext:30716741
fixshowwlkth:30771523
showindicator:30805243
pythongtdpath:30726887
i26e3531:30792625
welcomedialog:30812478
pythonnosmt12:30779711
pythonidxpt:30768918
pythonnoceb:30776497
copilotsettingc:30808720
dsvsc013:30777762
dsvsc014:30777825
diffeditorv2:30786206
pythonmpswarning:30859870
dsvsc015:30821418
pythontestfixt:30859590
pythonregdiag:30859652
pythonmypyd1:30859725
pythoncet0:30859736

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 16, 2023
@dataders dataders changed the title environment double activated? environment duplication -- interference with conda init Oct 16, 2023
@karrtikr
Copy link

@dataders Thanks for reaching out, the behavior is actually the similar to what conda does:

image

If you notice at the PATH environment variable, base env (/opt/conda/bin) is configured to be on PATH, similar to what we do:
image

To fix the UI you can run the following command:

conda config --set auto_activate_base False

and restart the shell. But things should already work as is.

We plan to improve the UI to just show (dbt) with #22128.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 17, 2023
@karrtikr karrtikr added the experimenting Feature is part of an experiment label Oct 18, 2023
@dataders
Copy link
Author

dataders commented Oct 26, 2023

@karrtikr thanks for the helpful response!

I can see the light at the end of tunnel y'all are in for improved UX for Python environment management in VSCode. I had gotten so used to the manual env activation post shell launch, but now with your provided extra conda config, I can see a brave new world!

I've added the config you mentioned (dataders/dotfiles@71db253), but am I correct in understanding that in a future release, it won't be needed anymore? Still trying to wrap my head around future happy path for env management -- though would be more than happy to contrib to user docs on this once #22128 is shipped.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 26, 2023
@dataders
Copy link
Author

p.s. as someone who works with Python and VSCode everyday your work is very much appreciated. Especially because you and the vscode-python team double down on contributing to not just this extension, but outside of your project to effectively the entire Python ecosystem. To me that's the real magic going on here.

Here's hoping for the next generation of Python devs not having to go as deep into environment and package management as we find ourselves today.

Cheers!

@karrtikr
Copy link

Thanks for your kind words! Here's what we've currently planned for the docs: microsoft/vscode-docs#6590, your willingness to help improve it is much appreciated.

but am I correct in understanding that in a future release, it won't be needed anymore?

That's right.

Here's our complete plan for environment activation feature in case you're interested: #20950. Cheers!

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experimenting Feature is part of an experiment info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants