0

I have a project structure in VSCode like this:

Project/
  .venv/
    virtual environment containing pip packages like numpy
  config/
    __init__.py
    useful scripts
  src/
    program.py

I want program.py to be able to import packages from the virtual environment as well as the config package I made.

The issue is that it's not detecting the "config" module. I'm afraid that if I do something like append the system path, it will just make the virtual environment modules undetected instead. Do I have to change my project structure or is there an easier way?

Lavaa
  • 25
  • 4
  • Does it remain true when you leave VSCode and try doing something from terminal? If yes, then PATH modification is the way to go (and no, it shouldn't break virtualenv unless you override instead of appending), and VSCode mention is unrelated. If no, then this question heavily needs [visual-studio-code]. – STerliakov Jan 27 '23 at 15:24
  • If running from the terminal: have you activated your virtual environment? If running with code runner: did you set the interpreter to the python executable in the venv? – Fractalism Jan 27 '23 at 15:28
  • Yeah, the venv is activated and selected as the interpreter. – Lavaa Jan 27 '23 at 22:11

0 Answers0