Some Python libraries do not ship with built-in type hints. Pylance might successfully find the code but complain that it cannot find the type definitions.

By default, Poetry creates virtual environments in a centralized, hidden directory cache on your system (e.g., ~/.cache/pypoetry/virtualenvs on macOS/Linux or %USERPROFILE%\AppData\Local\pypoetry\Cache\virtualenvs on Windows).

The fastest way to resolve this is to point VS Code to the specific virtual environment created by Poetry.

"python.analysis.extraPaths": [ "./src", "./path/to/ProjectB" ]

# Delete the existing cache-based environment poetry env remove --all # Re-install dependencies to create the local .venv poetry install Use code with caution. Step 3: Tell VS Code where to look

If you have a src/ layout (e.g., import mylib.core from src/mylib/core.py ), Pylance often misses those internal imports. Add a pyproject.toml section for Pylance:

The blue squiggles remained. The code was gaslit by its own linter.

Don't live with missing imports. Configure your interpreter, update your Pyright settings, or move the .venv inside. Your IDE—and your sanity—will thank you.

Poetry, by default, creates its virtual environments in a centralized cache directory, often outside your project folder, for example, ~/Library/Caches/pypoetry/virtualenvs/ on macOS or %LOCALAPPDATA%\pypoetry\Cache\virtualenvs\ on Windows. VS Code's automatic discovery doesn't always scan these locations, leading to Pylance using the wrong interpreter or not finding your packages.

If you applied the fixes above and Pylance still shows missing imports, try these troubleshooting steps:

The core folder sat right next to the src folder. A beautiful, local, editable install.