The April 2025 release of the Python and Jupyter extensions for Visual Studio Code is now available. This update introduces enhancements to the Copilot experience in Notebooks, improved support for editable installs, faster and more reliable diagnostics, and the addition of custom Node.js arguments with Pylance, and more!
Anyone have a good solution for projects with multiple sub-projects? My structure is like this:
root - no venv
project_a
.venv
app/
project_b
.venv
app/
To get completions to work, I need to manually switch venvs since each uses imports like app.a.b.c. But I frequently work on multiple projects at the same time, so I’d like it to switch venvs based on where the file lives.
Anyone know if that’s possible? I’m probably missing something obvious since this seems like a fairly common thing.
I can’t say that I’ve tried this for python, but have you looked into multi-root workspaces? That is how my current C++ and cmake setup performs, so Python might have something similar.
Anyone have a good solution for projects with multiple sub-projects? My structure is like this:
To get completions to work, I need to manually switch venvs since each uses imports like
app.a.b.c
. But I frequently work on multiple projects at the same time, so I’d like it to switch venvs based on where the file lives.Anyone know if that’s possible? I’m probably missing something obvious since this seems like a fairly common thing.
I can’t say that I’ve tried this for python, but have you looked into multi-root workspaces? That is how my current C++ and cmake setup performs, so Python might have something similar.
Multi-root workspaces will let you choose the interpreter for each directory;
I think that’s the best way to make it work if you want to have more than one project in the same VS Code instance.
Look into modern package management system like poetry or UV ;3
You could use uv workspaces. It means you only have one venv though.
A VSCode multi-root workspace might also work.