1

我正在用stockfish AI 编写一个国际象棋游戏。但是,每当我尝试导入库时,我都会收到错误 PermissionError: [WinError 5] Access is denied. 我已经搜索了错误并没有找到任何可以解决我的问题的东西。我对python很陌生,所以简单的答案将不胜感激。这是我的代码:

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

这是错误:

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
4

0 回答 0