• notice
  • Congratulations on the launch of the Sought Tech site

Cannot find declaration to go to appears after python project migration

Copy the Python source code to a new computer (Python environment has been installed), and found that operating ctrl+left mouse button on the third-party library name prompts Cannot find declaration to go to


1. There is a situation where this third-party library is not installed. The solution is to install it with pip

2. Another situation is that the third-party library has been installed, but Cannot find declaration to go to still appears

1. Right-click the entire project folder in the file navigation bar on the left, then right-click and select Mark Directory as -> Sources Root


2. Click File -> Settings to enter the setting interface, click Project on the setting interface: python -> Python Interpreter -> <No interpreter> -> Python 3.10 (select the Python installed on your computer) -> OK to complete


3. After the above processing, if the problem still exists, you need to re-create the virtualized project environment. After finishing a project, you hope that you can run it directly on another system without installing the modules it depends on once. , then virtualize the project environment, and my project itself has undergone computer migration, so it fits this solution very well

File -> New Project


problem solved


Technical otaku

Sought technology together

Related Topic


Leave a Reply