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

Conda fails to activate in fish shell when in pythonTerminalEnvVarActivation experiment #21895

Closed
lramos15 opened this issue Aug 29, 2023 · 8 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@lramos15
Copy link
Member

Testing #21298

Reproduced using the python codespace.

Created a conda environment via the terminal and can activate it via conda activate <name> but fails to auto activate

Image

2023-08-29 19:40:45.761 [debug] Clearing context for python dependencies not installed: /workspaces/vscode-python/tpiVenv/bin/activate.fish
2023-08-29 19:40:47.119 [debug] Shell path '', base path ''
2023-08-29 19:40:47.119 [debug] Shell path identified as shell 'other'
2023-08-29 19:40:47.119 [debug] Terminal name '' identified as shell 'other'
2023-08-29 19:40:47.119 [debug] [object Object]. Shell identified as other (Terminal name is )
2023-08-29 19:40:47.119 [debug] Shell path '/usr/bin/fish', base path '/usr/bin/fish'
2023-08-29 19:40:47.119 [debug] Shell path identified as shell 'fish'
2023-08-29 19:40:47.119 [debug] Terminal shell path '/usr/bin/fish' identified as shell 'fish'
2023-08-29 19:40:47.119 [debug] [object Object]. Shell identified as fish (Terminal name is )
2023-08-29 19:40:47.119 [debug] Shell identified as 'fish'
2023-08-29 19:40:47.119 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:47.120 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:47.120 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:47.120 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:47.120 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:47.120 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:47.220 [debug] Command sent to terminal: source /workspaces/vscode-python/tpiVenv/bin/activate.fish
2023-08-29 19:40:47.220 [info] Send text to terminal: source /workspaces/vscode-python/tpiVenv/bin/activate.fish
2023-08-29 19:40:48.947 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:48.947 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:48.947 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-08-29 19:40:48.947 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:48.947 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:48.947 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:48.947 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:48.949 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/workspaces/vscode-python/tpiVenv/bin/python"-Arg-Separator-undefined
2023-08-29 19:40:48.995 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-08-29 19:40:49.245 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:49.245 [debug] Clearing context for python dependencies not installed: /workspaces/vscode-python/tpiVenv/bin/activate.fish
2023-08-29 19:40:49.246 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:49.246 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:49.246 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/workspaces/vscode-python/tpiVenv/bin/python"-Arg-Separator-{"uri":{"$mid":1,"fsPath":"/workspaces/vscode-python","external":"file:https:///workspaces/vscode-python","path":"/workspaces/vscode-python","scheme":"file"},"name":"vscode-python","index":0}
2023-08-29 19:40:49.294 [debug] Clearing context for python dependencies not installed: /workspaces/vscode-python/tpiVenv/bin/activate.fish
2023-08-29 19:40:49.852 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:49.852 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-29 19:40:49.852 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-08-29 19:40:49.852 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:49.852 [debug] Found cached env for /workspaces/vscode-python/tpiVenv/bin/python
2023-08-29 19:40:49.852 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:49.852 [debug] Resolved /workspaces/vscode-python/tpiVenv/bin/python from cache: {"name":"tpiVenv","location":"/workspaces/vscode-python/tpiVenv","kind":"virt-venv","executable":{"filename":"/workspaces/vscode-python/tpiVenv/bin/python","sysPrefix":"/workspaces/vscode-python/tpiVenv","ctime":1693335931477,"mtime":1693335931477},"searchLocation":{"$mid":1,"fsPath":"/workspaces/vscode-python/tpiVenv","path":"/workspaces/vscode-python/tpiVenv","scheme":"file"},"display":"Python 3.11.3 ('tpiVenv': venv)","version":{"major":3,"minor":11,"micro":3,"release":{"level":"final","serial":0},"sysVersion":"3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/workspaces/vscode-python/tpiVenv/bin/python","detailedDisplayName":"Python 3.11.3 ('tpiVenv': venv)"}
2023-08-29 19:40:49.853 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/workspaces/vscode-python/tpiVenv/bin/python"-Arg-Separator-undefined
2023-08-29 19:40:49.901 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 29, 2023
@lramos15
Copy link
Member Author

Environemnt contributions

# Terminal Environment Changes

## Extension: GitHub.codespaces

- `CODESPACE_VSCODE_FOLDER=/workspaces/vscode-python`

## Extension: vscode.git

Enables the following features: git auth provider

- `GIT_ASKPASS=/vscode/bin/linux-x64/6c3e3dba23e8fadc360aed75ce363ba185c49794/extensions/git/dist/askpass.sh`
- `VSCODE_GIT_ASKPASS_NODE=/vscode/bin/linux-x64/6c3e3dba23e8fadc360aed75ce363ba185c49794/node`
- `VSCODE_GIT_ASKPASS_EXTRA_ARGS=`
- `VSCODE_GIT_ASKPASS_MAIN=/vscode/bin/linux-x64/6c3e3dba23e8fadc360aed75ce363ba185c49794/extensions/git/dist/askpass-main.js`
- `VSCODE_GIT_IPC_HANDLE=/tmp/vscode-git-9bfcc615e4.sock`

@karrtikr
Copy link

This doesn't look like the complete debug logs. Also

Send text to terminal: source /workspaces/vscode-python/tpiVenv/bin/activate.fish

seems to indicate that we're not in pythonTerminalEnvVarActivation experiment.

@lramos15
Copy link
Member Author

image

Maybe I need to start and start the codespace?

I reloaded the window and am just doing this through the browser connected to the codespace

@karrtikr
Copy link

karrtikr commented Aug 29, 2023

Ah, in codespaces you need to set the Remote settings to use the experiment, not User setting.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Aug 29, 2023
@lramos15
Copy link
Member Author

Okay the error is different now, but I still don't think it worked

Output:

2023-08-30 15:34:01.477 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-30 15:34:01.477 [debug] Clearing context for python dependencies not installed: /home/node/.vscode-remote/data/Machine/settings.json
2023-08-30 15:34:01.478 [debug] Found cached env for /home/node/.conda/envs/condaTPI/bin/python
2023-08-30 15:34:01.478 [debug] Resolved /home/node/.conda/envs/condaTPI/bin/python from cache: {"name":"condaTPI","location":"/home/node/.conda/envs/condaTPI","kind":"virt-conda","executable":{"filename":"/home/node/.conda/envs/condaTPI/bin/python","sysPrefix":"/home/node/.conda/envs/condaTPI","ctime":1693337556913,"mtime":1693337556913},"display":"Python 3.11.4 ('condaTPI')","version":{"major":3,"minor":11,"micro":4,"release":{"level":"final","serial":0},"sysVersion":"3.11.4 (main, Jul  5 2023, 13:45:01) [GCC 11.2.0]"},"arch":3,"distro":{"org":"Anaconda, Inc."},"source":[],"type":"Conda","id":"/home/node/.conda/envs/condaTPI/bin/python","detailedDisplayName":"Python 3.11.4 ('condaTPI': conda)"}
2023-08-30 15:34:01.478 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/home/node/.conda/envs/condaTPI/bin/python"-Arg-Separator-undefined
2023-08-30 15:34:01.526 [debug] Clearing context for python dependencies not installed: /home/node/.vscode-remote/data/Machine/settings.json
2023-08-30 15:34:05.397 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-30 15:34:05.398 [debug] Cached data exists KeyPrefix=Cache_Method_Output_b._selectIfLaunchedViaActivatedEnv-Args=true
2023-08-30 15:34:05.398 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2023-08-30 15:34:05.401 [debug] Found cached env for /home/node/.conda/envs/condaTPI/bin/python
2023-08-30 15:34:05.401 [debug] Found cached env for /home/node/.conda/envs/condaTPI/bin/python
2023-08-30 15:34:05.401 [debug] Resolved /home/node/.conda/envs/condaTPI/bin/python from cache: {"name":"condaTPI","location":"/home/node/.conda/envs/condaTPI","kind":"virt-conda","executable":{"filename":"/home/node/.conda/envs/condaTPI/bin/python","sysPrefix":"/home/node/.conda/envs/condaTPI","ctime":1693337556913,"mtime":1693337556913},"display":"Python 3.11.4 ('condaTPI')","version":{"major":3,"minor":11,"micro":4,"release":{"level":"final","serial":0},"sysVersion":"3.11.4 (main, Jul  5 2023, 13:45:01) [GCC 11.2.0]"},"arch":3,"distro":{"org":"Anaconda, Inc."},"source":[],"type":"Conda","id":"/home/node/.conda/envs/condaTPI/bin/python","detailedDisplayName":"Python 3.11.4 ('condaTPI': conda)"}
2023-08-30 15:34:05.401 [debug] Resolved /home/node/.conda/envs/condaTPI/bin/python from cache: {"name":"condaTPI","location":"/home/node/.conda/envs/condaTPI","kind":"virt-conda","executable":{"filename":"/home/node/.conda/envs/condaTPI/bin/python","sysPrefix":"/home/node/.conda/envs/condaTPI","ctime":1693337556913,"mtime":1693337556913},"display":"Python 3.11.4 ('condaTPI')","version":{"major":3,"minor":11,"micro":4,"release":{"level":"final","serial":0},"sysVersion":"3.11.4 (main, Jul  5 2023, 13:45:01) [GCC 11.2.0]"},"arch":3,"distro":{"org":"Anaconda, Inc."},"source":[],"type":"Conda","id":"/home/node/.conda/envs/condaTPI/bin/python","detailedDisplayName":"Python 3.11.4 ('condaTPI': conda)"}
2023-08-30 15:34:05.401 [debug] Cached data exists KeyPrefix=Cache_Method_Output_E.ensureEnvironmentContainsPython-Args="/home/node/.conda/envs/condaTPI/bin/python"-Arg-Separator-undefined
2023-08-30 15:34:05.446 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
image

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Aug 30, 2023
@karrtikr
Copy link

karrtikr commented Aug 30, 2023

This was already fixed in main branch some while ago, we especially ignore setting these env vars:

function shouldSkip(env: string) {
return ['_', 'SHLVL'].includes(env);
}

It's leading to me believe that you're probably not using the latest pre-release of the extension. The logs doesn't seem to be complete, so I'm unable to confirm this.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Aug 30, 2023
@lramos15
Copy link
Member Author

It's leading to me believe that you're probably not using the latest pre-release of the extension. The logs doesn't seem to be complete, so I'm unable to confirm this.

image

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Aug 30, 2023
@karrtikr
Copy link

Discussed offline, everything seems to work as expected for fish shell, confirmed we run into microsoft/vscode#184009.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@karrtikr karrtikr changed the title Conda fails to activate in fish shell Conda fails to activate in fish shell when in pythonTerminalEnvVarActivation experiment Sep 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants