0

I have the following project structure:

enter image description here

and I would like to be able to run my project from the command line using something like:

hotel-reservation> python hotel_reservation

However, when doing this I am receiving the following error:

ImportError: No module named 'hotel_reservation'

The code that I have in __main__.py is something as:

from hotel_reservation.utils import get_client_type_and_dates
from hotel_reservation.hotel import Hotel
from hotel_reservation.hotel_reservation_system import HotelReservationSystem


def main():
    # CODE
if __name__ == "__main__":
    main()

I guess I am missing how to indicate python that hotel_reservation is a the parent directory, so how can I solve this?

Thanks in advance.

lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228

0 Answers0