I want to use stockfish in my colab notebook.
I first tried with the chess.engine.SimpleEngine.popen_uci()
command, which seems to be outdated, since module 'chess.engine' has no attribute 'SimpleEngine'
So I tried with stockfish itself:
from stockfish import Stockfish
stockfish = Stockfish('/usr/local/lib/python3.7/dist-packages/stockfish')
Here I always get the error:
Permission denied: '/usr/local/lib/python3.7/dist-packages/stockfish'
I googled for it and came up with some good tries:
I tried with !chmod +x '/usr/local/lib/python3.7/dist-packages/stockfish'
which compiled, but didn't resolved the problem, and !chmod +x 'stockfish'
, which didn't find the folder.
So how exactly do I give permission to use the stockfish folder?
You need to set the os.setuid to 0 like this code below: