Stockfish: PermissionError: [WinError 5] Access is denied

894 views Asked by At

I am coding a chess game with the stockfish AI. However whenever i try to iport the library i get the error PermissionError: [WinError 5] Access is denied. I have searched up the error and havent found anything that has fixed my issue. I am pretty new to python so simple answers would be greatly appreciated. Here is my code:

from stockfish import Stockfish
stockfish = Stockfish(r"/users/meyer/appdata/local/programs/python/python39/lib/site-packages/stockfish")

And this is the error:

Traceback (most recent call last):
  File "C:\Users\meyer\Desktop\Python\Chess\Chess ai.py", line 3, in <module>
    stockfish = Stockfish(r"/users/meyer/appdata/local/programs/python/python39/lib/site-packages/stockfish")
  File "C:\Users\meyer\AppData\Local\Programs\Python\Python39\lib\site-packages\stockfish\models.py", line 35, in __init__
    self.stockfish = subprocess.Popen(
  File "C:\Users\meyer\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\meyer\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] Access is denied
0

There are 0 answers