You can set the setting(true) below to settings.json
for auto import. *Pylance extension installed automatically when Python extension is installed has the setting(true) below which is false
by default and you can see my answer explaning how to open settings.json
:
// "settings.json"
{
...
"python.analysis.autoImportCompletions": true
}
Then, it shows all matched attributes and modules as shown below:
Then, pressing Enter can automatically import what you select as shown below:
In addition, if you don't set the setting(true) below to settings.json
for auto import:
// "settings.json"
{
...
// "python.analysis.autoImportCompletions": true
}
Then, it only shows below: