Search code examples
pythonpycharm

How do I tell PyCharm where to find the actual location of my source code and imports


How do I tell PyCharm where to find my python source code

In the image below, python is open at a project level because I prefer having access to proto files aswell as the source code

But, PyCharm highlights my import statements because it is searching for the module nodes_pb2 at the project source

But I want it to search in src/ folder, How do I do that the problem

Here is my run configuration

I am running UnrealFlow as a python module from the src/ directory my pycharm run config


Solution

  • Inside pycharm click into File -> Settings -> Project: Your Project Name -> Project Structure.

    Set the src folder as the Source Folder. There are also another types of folders that you may use in your project, like tests, excluded, etc.