运行Pystockfish时出现FileNotFoundError

时间:2020-10-07 12:43:54

标签: python-3.x python-chess

我基本上是在尝试制作一种简单的国际象棋引擎,您在其中输入一个动作,然后该引擎返回最佳动作。这是我正在使用的代码:

import time
import random
from pystockfish import *

def play():
    deep = Engine(depth=20)
    deep.setposition(['e2e4'])
    deep.bestmove()
play()

我运行它,但出现此错误:

Traceback (most recent call last):
  File "C:\Users\JoJoUN.School6th-PC.000\Desktop\Experimental code\chess\GladiatorChess.py", line 12, in <module>
    play()
  File "C:\Users\JoJoUN.School6th-PC.000\Desktop\Experimental code\chess\GladiatorChess.py", line 9, in play
    deep = Engine(depth=20)
  File "C:\Users\JoJoUN.School6th-PC.000\AppData\Local\Programs\Python\Python37\lib\site-packages\pystockfish.py", line 128, in __init__
    stdout=subprocess.PIPE, )
  File "C:\Users\JoJoUN.School6th-PC.000\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "C:\Users\JoJoUN.School6th-PC.000\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1155, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

为便于记录,我从Eventtoken.h header - Win32 apps | Microsoft Docs那里获得了代码 我查看了“类似问题”列表中的问题,但是#1我不完全理解它们,而#2我不完全理解错误消息。请帮帮我。

谢谢!

编辑:我试图在Windows 10计算机上的常规Python.org shell中的Python 3.8(32位)上运行它。

0 个答案:

没有答案
相关问题