[Python] Getting VSCode to extend path to a different directory

Discussão em 'Python' iniciado por Stack, Janeiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    My project structure is:

    .
    └── src
    ├── app
    └── scripts


    Previously, app and scripts were at the top level, and app was called src. In scripts, I often refer to the app code, and so have

    sys.path.append(str((code_path / "app").resolve()))


    in there, so it access the code. Previously, VSCode was able to make the connection and I could do things like ctrl + click on a module and it would take me to the module in the former src/now app folder. However now, VSCode gives me error squiggles under all the module imports, as it can't find them, relatively speaking. I'd like to tell VSCode to include src/app into it's search path for code.

    Continue reading...

Compartilhe esta Página