this post was submitted on 07 Apr 2025
14 points (81.8% liked)

Python

7268 readers
6 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] sugar_in_your_tea@sh.itjust.works 3 points 3 months ago (6 children)

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.

[–] nutcase2690@lemmy.dbzer0.com 1 points 3 months ago (1 children)

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.

I'll check it out, thanks for the tip. I don't know much about VSCode, I'm more of a vim person, but I've been using it more and more at work.

load more comments (4 replies)