VS Code's Python extension automatically loads .env files.
: Open the Command Palette ( Ctrl+Shift+P ) and run Python: Restart Language Server . This forces Pylance to re-index your project dependencies. pylance missing imports poetry hot
: Use the python.analysis.extraPaths setting to explicitly tell Pylance where your libraries are. VS Code's Python extension automatically loads