Repository navigation
Issues working on workspaces with multiple components subfolders, each with it's own venv. #1032
Description
Hard to describe it completely, seems the core of the issue comes that at some point this has been designed for a single project single venv workspace.
I'll try to illustrate the situation with a sequence of screenshots and status/actions.
The screenshots will show four sections:
- The two above are from the old "Python Environment Manager (deprecated)" plugin and provided as a reference of expected behavior.
- The two bellow belong to this "vscode-python-environments"
Note
It's important to mention that this behavior happens the same if the old plugin is removed, so no interference in-between is the root cause of the issue.
Note
Also important to mention that on most "choose environment" actions that uses top drop down the missing venvs are not shown AND there are not a "browse" option, the only way to get the "browse" is using the bottom bar - left side - environment section.
This makes cumbersome to work with notebooks, for example, that each one belongs to a different environment, as many unexpected and not obvious steps has to be taken to properly make them connect to the right venv.
Issue detailed description follows from this point:
We have opened a workspace folder which contains several subfolders each of one belong to a different repository.
I.e: Think of it as each one is a component of a multiservice project.
The old plugin shows them properly:
-
2
venvenvironments: One of them is made usinguvthe other is barepython -m venv .venv. -
3
PyEnvpython versions available (The default one shown as "Global" here.) -
3
pipenvenvironments: One does not belongs to this project actually but as its centralized is shown, I understand this behavior. -
The "Workspace environments" properly shows the two
venvones that are in fact.venvfolders inside this workspace projects/subfolders.
(Showing here also which ones of pipenv belongs would be nice, it can be decided by the venvs meta info that is present and can be seen unfolding them, but that's just a side suggestion)
The current plugin is missing one of the venvs, it shown only the one is currently chosen.
Everything else is shown properly, only the venv section does not populates right.
Now we have used the bottom bar - left side - environment section to choose the missing environment and thus it makes the new plugin aware of it.
To make this possible we need to choose the "browse" option as the missing one it's not showing on the drop down.
The old plugin still shows them properly with a exception:
- The "Workspace environments" now shows the one we just choose duplicated and misses the other one. (We don't care about this now)
The current plugin now correctly shows both venvs.
- But on the "Python Projects" section the previous one is gone now.
Now we refresh the widgets.
The old plugin now correctly shows both venvs again.
The current plugin is now missing the other venv, it again shows only the one is currently chosen.

Activity
eleanorjboyd commentedon Dec 8, 2025
Thank you for the detailed issue! I will investigate!
Carbaz commentedon Feb 2, 2026
I have an update on this. I recently created a new .venv inside a subfolder of another subfolder, and now both extensions fail to retain all detected environments. As a result, I need to rely on the “Browse…” option (as mentioned earlier) to manually point VS Code to one environment or another in order to select them as kernels for my IPython/Jupyter notebooks.
Below is an example tree structure of the workspace:
As shown, the workspace contains several subfolders for components or groups of components. They do not all use the same environment manager, and they are not all maintained by the same team.
In summary, this is not an extremely complex workspace, but it is also not a flat one. It is a realistic multi‑repository, multi‑environment setup. The venv‑based environments (including those using .venv/ inside uv‑managed components) are not reliably detected or retained by VS Code.
On a positive note, the extension does correctly distinguish between uv‑managed environments and native venv environments, and it labels them accordingly. So at least the identification of the environment type seems to be working as expected, even though not all venv‑based environments are reliably detected or retained.
eleanorjboyd commentedon Feb 4, 2026
Reviewing this further I have an idea of what the problem is and would love if you can give it a try and let me know.
The design of the python-env extension does NOT search for any venvs in your workspace lower than what is at the root directory. This is for performance reasons, we don't want to do a huge grep search through your repository. This means that we only look in certain places but we have ways for you to dictate those places to search. What I think you need to do- is add the folder which is the parent of the env you are looking for as a project. This project definition then allows it to get found. If you don't want to - and the venv is not for a "project" then you can also use these settings for search paths.
but my recommendation is add
workspace-root-folder/component1as a project and thenworkspace-root-folder/component2/.venvwill be found. To add a python project- just right click on the folder in the explorer view and you should see an option "add as python project"Search for not venv happen a different way so let me know if any of those aren't working. Adding it as a project is still the best move but some environment managers as we have them defined will just search the common locations where the tool stores environments.
Hope this helps and let me know how it goes!
eleanorjboyd commentedon Feb 4, 2026
Here is a first draft of some documentation Im writing which I think should answer your question. If it does- I would really appreciate any thoughts you have on how we could introduce features into the extension that may make this discovery process easier and less confusing.
How Interpreter Discovery Works
This guide explains how the Python Environments extension discovers Python interpreters and environments in your workspace. Understanding this process helps you configure the extension correctly and troubleshoot common issues like missing environments.
Overview
The extension uses a two-pronged approach to find Python environments:
This targeted approach is faster than scanning your entire filesystem and ensures environments are associated with the correct projects.
Why the Extension Doesn't Search Your Entire Workspace
A common question is: "Why doesn't the extension just search everywhere?"
This is due to performance. It is very costly to have to search an entire, gigantic repository for any environments. Instead we want the user to tell us where to search so we are performant.
Project Roots and Environment Discovery
When you add a folder as a Python project, the extension searches that folder and its subdirectories for Python environments.
How Projects Drive Discovery
The native Python finder receives a list of
workspaceDirectories—these are the paths of all registered Python projects. For each project, the finder looks for:.venv,venv,.virtualenv, etc.)pyproject.tomland Poetry configuration)Pipfile)Example: Mono-repo with Multiple Services
Key insight: If
backend/andfrontend/are not added as projects, their.venvfolders won't be discovered or properly associated with those directories.Adding Projects
To add subfolders as projects:
option 1: Right-click a folder in Explorer and select Add as Python Project
option2:
See Managing Python Projects for detailed instructions.
Search Path Settings
For environments stored outside your workspace, or in locations not registered as projects, use search path settings.
python-envs.globalSearchPathsPaths searched regardless of which workspace is open. Use this for environments you want available across all your projects.
[]Example:
{ "python-envs.globalSearchPaths": [ "~/envs", "/opt/python/environments", "~/.virtualenvs" ] }python-envs.workspaceSearchPathsPaths searched for the current workspace. Supports both absolute paths and paths relative to the workspace root.
[]Example:
{ "python-envs.workspaceSearchPaths": [ "environments", "../shared-envs", "/team/shared/python-envs" ] }Glob patterns are NOT YET supported- coming soon!
***services/*/.venv.venvinside any immediate subfolder ofservices/**/environmentsenvironmentsat any depthLegacy Settings Migration
If you previously used these settings from the Python extension, they continue to work:
python.venvPath: Single path to a folder containing virtual environmentspython.venvFolders: Array of folder names relative to your home directoryThe extension reads both the legacy settings and the new
globalSearchPaths/workspaceSearchPathssettings, combining them for discovery.The Discovery Process
When the extension activates or refreshes, here's what happens:
globalSearchPaths, andworkspaceSearchPathsare combinedFAQ: Why Can't the Extension Find My Environment?
"My environment is in a subfolder of my workspace"
Cause: The subfolder is not registered as a Python project.
Solution: Add the subfolder as a project:
"My environments are in a central location outside the workspace"
Cause: The location is not in your search paths.
Solution: Add it to
globalSearchPaths:{ "python-envs.globalSearchPaths": [ "/path/to/your/environments" ] }Carbaz commentedon Feb 5, 2026
Thanks, Eleanor Boyd (@eleanorjboyd), I wasn’t aware of the Add as Python Project feature. I’ll review it in detail.
Here is the corrected link you shared: Managing Python Projects
Regarding other environment managers such as pipenv or poetry, I haven’t seen issues in similar setups.
Their centralized environment locations make discovery predictable, so what you mentioned aligns with my experience.
I’ll test the project based discovery flow across my workspace structure and share the results once I have them.
Carbaz commentedon Feb 5, 2026
I’ve been testing it for a while and it works perfectly for my use case. It turns out this was the right approach from the beginning. Sorry for not noticing that feature earlier.
Since the extension usually behaves automatically, it’s not obvious that some folders need to be registered manually as projects. That manual step is correct, just not very visible. Maybe the extension could suggest marking folders as projects when it detects more than one venv in the workspace or when the active environment is not located at the root, as long as no projects have already been declared.
Note
This scenario does not only apply to monorepos. It also applies to umbrella‑style repositories and multi‑repository workspaces, where each component is its own repository but the workspace includes them all, as shown in my updated example tree.
The Source Control component handles this very well and can locate
.gitfolders, which allows it to recognize repositories up to a configurable depth through thegit.repositoryScanMaxDepthsetting. The way they perform that scan might offer a useful hint for improving environment autodetection.Thanks for taking the time to look into this.
From my side this can be closed, unless you prefer to handle the closure yourselves or want me to run any additional tests.
eleanorjboyd commentedon Feb 11, 2026
Hi! So glad to hear this is working for you! After your comments I went ahead and changed the default setting so now all
.venvin your workspace should be found as this continued to be a confusing aspect that was causing very valid confusion like you had.To your second point- about the context menu still showing add project I am working on that- turns out to be a bit harder than expected.
I will close this issue then but if you run into any other issues or have any followup feedback feel free to reach out. Happy coding!