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
{{ message }}
Repository navigation
Create environments automatically (or via UI command) #229
When selecting hatch environment that exists in the env matrix, but hasn't been created yet via "Select Interpreter" in vscode, nothing happens.
IMO there should be either
(1) a prompt "This env does not exist, do you want to create it now?", or
(2) an error message "This env does not exist, please create it using ..."
where ... should be a command from the command palette.
I had trouble parsing that sentence. You mean this right?
When using the Select Interpreter command in VS Code to select a Hatch environment that hasn't been created yet, nothing happens.
If so, yeah, that’s certainly a gotcha. If I understood the vscode-python-environments people correctly, the Select Interpreter command interacts with the legacy “global environment”, while selecting an environment in the vscode-python-environments sidebar selects a “workspace environment” (and triggers a Hatch env sync). But that doesn’t explain that VS Code also remembers which global environment each project has?
OK, so since the Python extension uses the Python Environments extension by default now, I think this isn’t as relevant anymore.
FYI, the Envs extension introduced a new concept called “project’s active environment” which is different from the legacy global active environment set by Select Interpreter. Most extensions like Ruff, ty, … support the project environment at this point, so the legacy global environment should be no longer relevant. If the project env isn’t recognized by an extension you use, please report it there, it’s a big hole at this point!
Using the Envs extension’s panel’s “Set as project interpreter” button (see below) will cause the Hatch extension to sync/create the env as you wanted!
Activity
flying-sheep commentedon Jul 6, 2026
I had trouble parsing that sentence. You mean this right?
If so, yeah, that’s certainly a gotcha. If I understood the vscode-python-environments people correctly, the Select Interpreter command interacts with the legacy “global environment”, while selecting an environment in the vscode-python-environments sidebar selects a “workspace environment” (and triggers a Hatch env sync). But that doesn’t explain that VS Code also remembers which global environment each project has?
That confusion is why I filed microsoft/vscode-python-environments#1485 and didn’t try to integrate with the global environment yet. @eleanorjboyd could you maybe help us out here?
grst commentedon Jul 6, 2026
I wasn't even aware that a vscode-python-environment sidebar exists 👀
flying-sheep commentedon Oct 21, 2026
OK, so since the Python extension uses the Python Environments extension by default now, I think this isn’t as relevant anymore.
FYI, the Envs extension introduced a new concept called “project’s active environment” which is different from the legacy global active environment set by Select Interpreter. Most extensions like Ruff, ty, … support the project environment at this point, so the legacy global environment should be no longer relevant. If the project env isn’t recognized by an extension you use, please report it there, it’s a big hole at this point!
Using the Envs extension’s panel’s “Set as project interpreter” button (see below) will cause the Hatch extension to sync/create the env as you wanted!