尝试在google colab中使用stockfish国际象棋分析时被拒绝的权限

2024-05-13 23:18:03 发布

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

我已经下载了stockfish,并将文件放在我的google驱动器中,这样就可以在colab中访问它,但是它不允许我执行文件,并且我得到了一个权限拒绝错误。有人知道如何解决这个问题吗

def stockfish(board, depth):
    with chess.engine.SimpleEngine.popen_uci('/content/drive/MyDrive/stockfish-3.13.0/stockfish') as sf:
        result = sf.analyse(board, chess.engine.Limit(depth=depth))
        score = result['score'].white().score()
    return score
PermissionError: [Errno 13] Permission denied: '/content/drive/MyDrive/stockfish-3.13.0/stockfish'

Tags: 文件boardgoogledriveresultcontentsfengine