管理员权限后拒绝WinError 5访问?

2024-05-14 13:29:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我通过pip install stockfish安装了一个名为stockfish的库

因此,我继续尝试通过以下方式设置Stockfish:

from stockfish import Stockfish

stockfish = Stockfish(r'C:\Users\Acer\Desktop\chess\stockfish-11-win')

抛出一个WinError 5,访问被拒绝:

Exception ignored in: <function Stockfish.__del__ at 0x0429AA48>
Traceback (most recent call last):
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\stockfish\models.py", line 270, in __del__
    self.stockfish.kill()
AttributeError: 'Stockfish' object has no attribute 'stockfish'
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    emily = Stockfish(r'C:\Users\Acer\Desktop\chess\stockfish-11-win\src')
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\stockfish\models.py", line 33, in __init__
    self.stockfish = subprocess.Popen(
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] Zugriff verweigert

我做了什么/尝试了什么? 我尝试了不同的Stockfish下载,以管理员的身份运行Idle或CMD,重新安装并使用了不同的PC,但不知何故,我无法使用Stockfish-有谁能帮我绕过拒绝访问?初始化时我会错过什么?尝试Stockfish返回<class 'stockfish.models.Stockfish'> ,因此它似乎已正确导入并正常运行


Tags: inpyselfmodelsliblocallineusers

热门问题