Running Python 3.10. I have three files in the same directory named Chess, one of which is a __init __.py to make sure it's considered a module.
In one file, ChessMain.py I have a line: from Chess import ChessEngine
When I run the file, I get the ModuleNotFoundError: No module named 'Chess' error.
Sorry if this is a dumb import question, but I can't seem to figure out what I'm doing wrong.
from .Chess importimport ChessEnginewithout theChessparentChessand try to import. If you are running insideChess, then that folder|module doesn’t exist and thus error. Either call your script outsideChess,cd .. && python Chess/ChessMain.pyOr use setPYTHONPATHto tell Python where it should look