I'm using pycharm and was unable to navigate to the base class from the child class code following format for the following project structure
dir 1 Base class dir 2 Child class when I import the class using this way, pycharm is not able to navigate to the base class but the Python file executes properly
sys.insert.path("../dir1/")
import baseclass
When I import the class using
import dir1.baseclass
Makes pycharm understand where the base classes and I navigate to it using shortcuts. The Python scripts executes properly with pycharm in this case.
I am not able to understand how python automatically can figure out the path of baseclass.py in import dir1.baseclass because I'd never gave the relative or absolute path of dir1. Does it automatically assume that dir1 is going to be at the same directory level as that of child class.
And why does pycharm behave differently with these statements for navigation works the same for execution?