Pycharm - Cannot find declaration to go to

后端 未结 3 1796
南笙
南笙 2021-01-07 21:13

I changed my project code from python 2.7 to 3.x.

After these changes i get a message \"cannot find declaration to go to\" when hover over any method and press ctrl

相关标签:
3条回答
  • 2021-01-07 21:26

    What worked for me was right-click on the folder that has the manage.py > Mark Directory as > Source Root.

    0 讨论(0)
  • 2021-01-07 21:32

    Right click on the folders where you believe relevant code is located ->Mark Directory as-> Sources Root

    Note that the menu's wording "Sources Root" is misleading: the indexing process is not recursive. You need to mark all the relevant folders.

    0 讨论(0)
  • 2021-01-07 21:35

    I had a case where the method was implemented in a base class and Pycharm couldn't find it.

    I solved it by importing the base class into the module I was having trouble with.

    0 讨论(0)
提交回复
热议问题