Search code examples
pythonpycharm

Cannot find declaration to go to, error in PyCharm


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

After these changes when I hover over any method and press Ctrl I get a message:

cannot find declaration to go to

I'm trying to update PyCharm from 2017.3 to 18.1, I removed the .idea directory but my issue still persists.


Solution

  • 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.