Repository navigation
Refreshing virtual environments keeps on spinning due to missing pyenv #1059
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
area-environmentEnvironment, interpreter related issues.Environment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterIssue requires more information from posterunder-discussionIssue is under discussion for relevance, priority, approachIssue is under discussion for relevance, priority, approach
Description
Within Visual Studio Code, at the bottom I keep on seeing "Refreshing Virtual Environments" with it spinning.
I've been able to narrow it down to the "Python Environments" extension. It was installed however I did not have "python.useEnvironmentsExtension" in my settings file.
Following is debug output for "Python Environments":
2025-12-12 08:11:21.598 [debug] Python-envs extension version: 1.14.0
2025-12-12 08:11:21.598 [info]
=== Python Envs Configuration Levels ===
2025-12-12 08:11:21.598 [info] {
"section": "Python Envs Configuration Levels",
"defaultEnvManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "undefined",
"globalValue": "undefined",
"defaultValue": "ms-python.python:venv"
},
"defaultPackageManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "undefined",
"globalValue": "undefined",
"defaultValue": "ms-python.python:pip"
}
}
2025-12-12 08:11:21.598 [debug] TerminalEnvVarInjector: Initializing environment variable injection
2025-12-12 08:11:21.598 [debug] TerminalEnvVarInjector: Updating environment variables for all workspaces
2025-12-12 08:11:21.598 [debug] TerminalEnvVarInjector: Env file injection disabled for workspace: <workspace>
2025-12-12 08:11:21.598 [debug] TerminalEnvVarInjector: Environment variable injection completed
2025-12-12 08:11:21.598 [info] [pet] Starting Python Locator /Users/<myid>/.vscode/extensions/ms-python.vscode-python-envs-1.14.0-darwin-arm64/python-env-tools/bin/pet server
2025-12-12 08:11:21.599 [debug] Finder - refreshing all environments
2025-12-12 08:11:21.600 [info] getAllExtraSearchPaths completed. Total unique search directories: 0 Paths: []
2025-12-12 08:11:21.600 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["<workspace>"],"environmentDirectories":[],"poetryExecutable":"poetry","cacheDirectory":"/Users/<myid>/Library/Application Support/Code/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2025-12-12 08:11:21.600 [debug] Finder - refreshing all environments
2025-12-12 08:11:21.601 [debug] Finder - refreshing all environments
2025-12-12 08:11:21.601 [debug] Finder - refreshing all environments
2025-12-12 08:11:21.614 [debug] Finder - refreshing all environments
2025-12-12 08:11:21.614 [debug] Finder - refreshing all environments
And following is the debug output from "Python":
2025-12-12 08:11:21.612 [debug] Testing: Setting up watcher for <workspace>
2025-12-12 08:11:21.612 [info] Native locator: Refresh started
2025-12-12 08:11:21.621 [debug] Dump environment variables {
"COMMAND_MODE": "unix2003",
"HOME": "/Users/<myid>",
"HOMEBREW_CELLAR": "/opt/homebrew/Cellar",
"HOMEBREW_PREFIX": "/opt/homebrew",
"HOMEBREW_REPOSITORY": "/opt/homebrew",
"INFOPATH": "/opt/homebrew/share/info:",
"LANG": "C.UTF-8",
"LOGNAME": "<myid>",
"MallocNanoZone": "0",
"OLDPWD": "/",
"OSLogRateLimit": "64",
"PWD": "/",
"SHELL": "/bin/zsh",
"SHLVL": "0",
"SSH_AUTH_SOCK": "<listener>",
"TMPDIR": "/var/folders/2n/4r5lk3vj50g4zbw4434kkynm0000gn/T/",
"USER": "<myid>",
"VSCODE_CODE_CACHE_PATH": "/Users/<myid>/Library/Application Support/Code/CachedData/618725e67565b290ba4da6fe2d29f8fa1d4e3622",
"VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
"VSCODE_CWD": "/",
"VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
"VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
"VSCODE_IPC_HOOK": "/Users/<myid>/Library/Application Support/Code/1.10-main.sock",
"VSCODE_NLS_CONFIG": "{\"userLocale\":\"en-us\",\"osLocale\":\"en-us\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"/Applications/Visual Studio Code.app/Contents/Resources/app/out/nls.messages.json\",\"locale\":\"en-us\",\"availableLanguages\":{}}",
"VSCODE_PID": "70553",
"XPC_FLAGS": "0x0",
"XPC_SERVICE_NAME": "application.com.microsoft.VSCode.1033250394.1033250430",
"_": "/Applications/Visual Studio Code.app/Contents/MacOS/Electron",
"__CFBundleIdentifier": "com.microsoft.VSCode",
"__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x0",
"ELECTRON_RUN_AS_NODE": "1",
"VSCODE_L10N_BUNDLE_LOCATION": "",
"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true",
"PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/laps"
}
2025-12-12 08:11:21.622 [info] > pyenv which python
2025-12-12 08:11:21.622 [info] cwd: .
2025-12-12 08:11:21.661 [debug] Error: Command failed: pyenv which python
/bin/sh: pyenv: command not found
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:418:12)
at ChildProcess.emit (node:events:531:35)
at maybeClose (node:internal/child_process:1101:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
code: 127,
killed: false,
signal: null,
cmd: 'pyenv which python'
}
2025-12-12 08:11:21.861 [debug] Received shell integration sequence for zsh
Issue thus seems to stem from pyenv not being on my Mac but I did not see anywhere requirements for this to be installed separately. Disabling "Python Environments" extension stopped the "spinning".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-environmentEnvironment, interpreter related issues.Environment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterIssue requires more information from posterunder-discussionIssue is under discussion for relevance, priority, approachIssue is under discussion for relevance, priority, approach
Activity
eleanorjboyd commentedon Dec 18, 2025
Thank you for reporting this issue! Yes clearly something is going wrong.
Karthik Nadig (@karthiknadig) looking into this a bit it seems we might have some items activating in the Python extension that we don't want given the environments extension is in use. From the logs, I can see that the Python extension is searching for the pyenv executable (as it is in those logs) which when I traced it up the stack to this. Here we
autoSelectInterpreter- >autoselectInterpreterWithLocators->this.envTypeComparer.initialize(resource);->const preferredPyenvInterpreter = await getActivePyenvForDirectory(cwd);. which then is where we look for pyenv, so that is the path I followed.Do we expect
autoSelectInterpreterto be activating when the python envs ext is enabled? Wondering on a higher level if I should disable this logic or if there is any interpreter logic that is kept in the python extkarthiknadig commentedon Dec 19, 2025
The autoSelectInterpreter should fallback to envs extension during the transition. Eventually, it should be removed in favor of env extensions selection system.
github-actions commentedon Jan 3, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!
github-actions commentedon Jan 23, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!
eleanorjboyd commentedon Feb 18, 2026
Hi! We have made substantial updates with the newest stable release
1.20.0and specifically a fix to the pyen error handling. If you can try it out and let us know if it works that would be great. Thanks!gregorymiami commentedon Mar 3, 2026
Hey. For what its worth, I am on version 1.20.1 and I am seeing the same issue in VS Code.
github-actions commentedon Mar 28, 2026
Hey Eleanor Boyd (@eleanorjboyd), this issue might need further attention.
ehendrix23, you can help us out by closing this issue if the problem no longer exists, or adding more information.
github-actions commentedon Apr 12, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!