I am new to Python's module and package system. I currently have the following directory structure
ProjectDirectory:
Main.py
EntitiesDirectory/
__init__.py
Trip.py
Plan.py
The init.py file is empty. The Plan.py contains a class definition for the class Plan. The class Trip looks like this
from Plan import Plan
Class Trip():
def__init__(self,plan:"Plan"):
do something with the plan object
When I run the Trip.py file inside from the Entities directory, there is no problem. However, when I try to import it n the Main.py file, I get the following error
from Entities.Trip import Trip
No module named Plan
I have tried work the following changes inside Trip.py file
from .Plan import Plan
from Entities.Plan import Plan
from . import Plan
However nothing worked (relative directory error with no parent module). I am using Python 3.11 inside Anaconda.