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:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/IaNlR.png)
Then, pressing Enter can automatically import what you select as shown below:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/YLFLS.png)
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:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/ovKvp.png)