I am using VSCode for Python along with the Microsoft for Python extension enabled in VSCode.
For Python v3.9.0 I am getting No definition found if I try to seek a function definition.
However, I do not get the error if I use my Conda Virtual environment for Python 3.7.0
What might be the problem?
Answers. Don't close Visual Studio but close all the files and open them again by clicking on the file in the solution. The file might have been opened by Source Safe or you maybe opened it from Windows Explorer. In this case the file doesn't get assosiated with your solution and the Go to Def.
When I used the code you provided and disabled the Python
extension, I encountered the same problem as you.
Since "Go to Definition
" is supported by the corresponding language service extension, it is recommended that you check that the current Python
extension is available and confirm that the selected python interpreter is also available. In addition, please try to reload VSCode.
I had the same problem and changing the python language server from Jedi to Microsoft or Pylance did fix the problem. To do this go to the settings with Cntrl + ,
and search for python.languageserver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With