In my case , what worked was reinstalling python extension on vscode which auto-install pylance.
then I just hit "ctrl + , " on my keyboard to take me to vscode setting
typed: pylance .
clicked on the edit setting.json and change the "python.languageServer" to default
},
"terminal.integrated.sendKeybindingsToShell": true,
"python.defaultInterpreterPath": "C:source\\env\\Scripts\\python.exe",
"python.disableInstallationCheck": true,
"terminal.integrated.defaultProfile.windows": "Command Prompt",
**"python.languageServer": "Default"**,
"python.analysis.completeFunctionParens": true,
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"python.autoComplete.addBrackets": true,
"diffEditor.ignoreTrimWhitespace": false
and I hope this works for you also else you can try reinstall intellicode and python extension then restart your vscode.
I hope you find this useful :)