• 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

image.png

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

image.png

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

image.png

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

image.png

problem solved

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+