Python-chess open UCI engine permission error denied

566 views Asked by At

I am currently creating a python script that opens a chess engine, Stockfish, using python-chess, and chess.uci. However, when I try opening up the stockfish engine, I get

PermissionError: [Errno 13] Permission denied

So I looked more into this issue, and apparently, you cannot open directories or folders directly. However, looking into the documentation for opening a UCI engine for python-chess, the example shows opening what seems to be a directory under /usr/bin

The documentation is here: https://python-chess.readthedocs.io/en/v0.23.10/uci.html

Is there any other way to open an engine using UCI? My OS system is Mac OS.

1

There are 1 answers

0
LittleCoder On

Ok, sorry, I'm late ^^ I've got the same problem few month ago. First, on Mac, be sure your file is not a .exe file. It should be a Mac executable (i.e. if you double click on your file, it will open the Terminal). If not, install Homebrew, and $ brew install stockfish. Next find the Stockfish executable path in your Finder and open a new Terminal window for its folder emplacement. Paste $ chmod +x your_stockfish_exe_name and retry to open Stockfish with Python.