0

I am making a chess bot, using stockfish and python. I have installed the chess library and all works fine until this line of code: chess.uci.popen_engine("stockfish"). I am then given the error: AttributeError: module 'chess' has no attribute 'uci'. Any help will be appreciated

ECMC
  • 1
  • 3
  • You appear to be using some very out-of-date sample code - that line hasn't been supported by the module in many years. The current version seems to be `chess.engine.SimpleEngine.popen_uci("stockfish")`. – jasonharper Nov 29 '22 at 19:19
  • That gets me the error `File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/chess/engine.py", line 620, in EngineProtocol @asyncio.coroutine ^^^^^^^^^^^^^^^^^ AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'? ` – ECMC Nov 29 '22 at 19:28
  • `asyncio.coroutine` was deprecated in Python 3.7 and finally removed in Python 3.11. As a result, you have a version of the package that will only work with something older than Python 3.11. (How much older, I couldn't say, not being familiar with the package.) – chepner Nov 29 '22 at 20:00

0 Answers0