The critical step:
poetry shell code .
To prevent this in the future, you can force Poetry to create virtual environments directly inside your project folder (in a .venv directory), which VS Code detects automatically. pylance missing imports poetry link
[tool.poetry] name = "my_project" version = "1.0.0" The critical step: poetry shell code