Below is a systematic, step-by-step guide to identifying and fixing the issue. The most common cause (incorrect interpreter) is listed first, but you should inspect the details of each to determine the best fit for your situation.
This is the correct, permanent solution. You need to tell VS Code which Python executable Poetry is using.
Now, look in your project folder. You will see a .venv directory. VS Code and Pylance will auto-detect it without any manual intervention. pylance missing imports poetry hot
: Press Ctrl+Shift+P / Cmd+Shift+P , type Python: Restart Language Server , and select it. This forces Pylance to clear its cache and rescan your paths.
Fortunately, there are some solutions and workarounds to help you overcome the issue of Pylance missing imports with Poetry and hot reloading: Below is a systematic, step-by-step guide to identifying
You might see advice online: "Just install the package globally." It pollutes your system Python and defeats the purpose of Poetry.
Run Pylance: Restart Server from the Command Palette. Still stuck? Run Developer: Reload Window . You need to tell VS Code which Python
# Print the Python interpreter being used python -c "import sys; print(sys.executable)"
"python.analysis.extraPaths": [ "./.venv/lib/python3.11/site-packages" ] Use code with caution.
: Delete your existing environment and run poetry install .