i have a folder format which looks like this:
|-checkers with AI
|-checkers
|-__init__.py
|-board.py
|-constants.py
|-__init__.py
|-main.py
the code i am using to import this in board.py is: from constants import BLACK, ROWS, RED, SQUARE_SIZE
and for main.py: from checkers.constants import WIDTH, HEIGHT from checkers.board import Board
for whatever reason im getting this error, i have spoken to other people and no one seems to have any idea what im doing wrong. i have tried moving all the code into main and running it without importing, doing it that way works but is very messy.
So my code isn't the problem, i have added __init__.py
into each and have added if __name__ == '__main__': main()
in main.py
now i am getting the error: ModuleNotFoundError: No module named 'constants'
anyone know anything?