AttributeError: module 'chess' has no attribute 'Board' chess board error

Viewed 155

i'm making chess in python i'm having this error

this my code:

import chess.board

board=chess.Board()

board

full error:

Traceback (most recent call last):
  File "chess.py", line 1, in <module>
    import chess
  File "D:\Websites\repoting\chess.py", line 3, in <module>
    board=chess.Board()
AttributeError: module 'chess' has no attribute 'Board'
1 Answers

If you import chess you can use chess.Board(). But if you import chess.Board you could only use Board()from module chess. I hope this will help you and everyone who will read this answer.

Related