Questions tagged [python-chess]

For questions about the python-chess library (for questions about your own chess algorithm, use the [chess] tag instead).

Refers to the python-chess library, developed by Niklas Fiekas.

python-chess is a pure Python chess library with move generation, move validation and support for common formats.

This tag should be used only for questions about the python-chess library.

For general questions about chess-playing algorithms, use the tag combined with the tag. If your question is not actually about chess or the algorithms involved, you should not use the tag.

External Links

129 questions
0
votes
1 answer

Errno 8 Exec Format Error - Stockfish/python chess

I am trying to access Stockfish evaluations through python chess, however, whenever I try to run the code, I am met with "[Errno 8] Exec format error". I tried running the some code off the documentation and am met with the same error. I read some…
Thayer
  • 35
  • 3
0
votes
1 answer

python-chess: ModuleNotFoundError: No module named 'chess.uci'

I'm trying to run a program that requires the modules chess and chess.uci. I do the "py -m pip install chess", but get the error message File "D:\Pythonfiler\sjakk\PySimpleGUI\Chess\Demo_Chess_AGAINST_AI.py", line 7, in import…
Patzer
  • 25
  • 4
0
votes
0 answers

Running pygame in Sublime Text 3

I'm currently working on a chess programm in Python. I use Sublime Text 3 as an IDE, but it doesn't seem to work properly for pygame. I created a chess board and whenever I run it in Sublime Text the board doesn't appear. Somehow it seems similar to…
0
votes
1 answer

How do you get the chess board function to work on spyder 3.7?

I've tried this: import chess_py as chess board=chess.Board() but in my kernel it gives this error: File "C:\Users\raghu\anaconda3\lib\site-packages\chess_py\core\board.py", line 67, in __init__ self.king_loc_dict = {white:…
0
votes
1 answer

How to get a 4v4 chess board version using the python chess library

I am trying to figure out how to use the chess library in python to get a 4x4 board instead of an 8x8 with Rook, Queen, King, and Rook at the back and the middle rows being Pawns. I tried setting up the board through this line but it gives an error…
Scrap
  • 1
0
votes
1 answer

Creating an Sqlalchemy table within a row to save chess move set

I have a table of games and I want to save the moves made in each game within this table. The only way I can think of doing this(without using pickles) is to have another table for each game to save the moves set. My problem is that I'm not sure how…
Aviv T
  • 5
  • 2
0
votes
1 answer

Legal user moves with python-chess

How is the legal moves function supposed to be used on python-chess? By running this code and entering e2e4. It turns out that the move is invalid. import asyncio import chess import chess.engine engine =…
9acca9
  • 19
  • 5
0
votes
3 answers

"AssertionError: push() expects move to be legal", showing a board that is not the one passed in

I'm trying to code a simple chess engine that looks for the move that yields the most material advantage. However, I'm running into an odd error that shows a board that is not the one I had passed into it. My code: def best_move(board): …
0
votes
1 answer

from Chess import ChessEngine: error on Chess Engine

I have reviewed the tutorial numerous times but still, I have this error. After the first video in the series, he is able to display the board. The error highlights ChessEngine on my import statement. this is my primary resource:…
0
votes
1 answer

How to make deep copy of a specific(mutable) object?

I'm trying to make a chess engine. def botmove(board): legal=list(board.legal_moves)#needed because --->TypeError: 'LegalMoveGenerator' object is not subscriptable boardhalfmove=board.pop() choosemove(board,boardhalfmove, legal) …
NRO
  • 76
  • 7
0
votes
1 answer

push_san() missing 1 required positional argument: 'san'

I am using the python-chess modal Input: list called 'pre' containing: ['e2e4','e7e5'] for x in range(0, len(pre)-1): move=chess.Move.from_uci(str(pre[x])) print(move) board.push_san(move()) print(board) The…
Kevin
  • 13
  • 4
0
votes
1 answer

Backtracking 8 Queens Python problems

I've started solving the 8 queens problem with backtracking in Python. Everything is nice & fine. It even printed out the first answer. However, it stuck itself on its first backtracking try. The task sounded in that way: Implement a Python function…
mnoznik01
  • 9
  • 1
  • 3
0
votes
1 answer

Infinite while loop stopping unexpectedly python threading

I hope you're having a good day :) Recently I have been making a chess program. I'm now at the point of making the AI and I'm using Stockfish for testing purposes. Since I need the computer to have time to evaluate without pausing the pygame game…
KNN
  • 35
  • 5
0
votes
1 answer

Stockfish chess engine gets: "EngineTerminatedError: engine process died unexpectedly" on Heroku

I am trying to build an AI chess bot, with a python back-end and React front-end. When I run it locally it works fine, but when deploying on Heroku for free, I get the following error message: result = engine.play(board,…
Steven
  • 11
  • 3
0
votes
1 answer

n a separate class why does taking in an instance of a class in that constructor result in no statement effect errors?

I'm creating a chess game in which I decided to implement two class, the piece class an abstract class extends to various abstract operations(Pawn, King, Queen, Rook, Knight, Bishop), and every piece will be placed on a spot. The spot class…
jona
  • 11
1 2 3
8 9