ahira-justice / chess-board

A chess board library for presenting game positions
https://pypi.org/project/chess-board
GNU General Public License v3.0
19 stars 12 forks source link

Pygame window freezing #1

Closed theg3ntlem4n closed 2 years ago

theg3ntlem4n commented 4 years ago

Hi! I'm currently trying to use your chessboard api with the python chess library (https://python-chess.readthedocs.io/en/latest/). Currently, my code is as follows:

import chess
from chessboard import display

board = chess.Board()
fen = board.fen()

while True:
     display.start(fen)

However, when I run the code, my pygame window freezes with a gray screen and won't display anything. I can only get out of it by exiting the program. Any tips?

ahira-justice commented 4 years ago

Hello @theg3ntlem4n , I'm sorry I haven't been checking my issue notifications, I just saw this. I'll get to work on the issue now. I'll run your the code you pasted and get back to you asap

ahira-justice commented 4 years ago

Hey @theg3ntlem4n , I just created a test project to run the code you pasted. It seems to work fine on my end. Although I'm finding some inconsistent behavior with the close/exit event.

Could you give me some more detail about your system configuration, os and python version? A few screenshots would be fine too.

theg3ntlem4n commented 4 years ago

Hi! I'm using a Macbook Pro 16 inch on Catalina 10.15.4 with 16 GB of RAM and 512 GB of storage. I have attached the screenshot from my output when I run the code. Thanks for your attention to the matter; it might be a problem from my end. Screen Shot 2020-05-18 at 12 16 20 AM

ahira-justice commented 4 years ago

Hi @theg3ntlem4n , I developed chess-board on a Windows machine. I used a windows machine to test it when I saw your issue yesterday. It could be some peculiarity with Unix machines. I'll get my hands on a Mac and Linux computer and do some testing there.

ahira-justice commented 4 years ago

Hello @theg3ntlem4n , I've done some searching and it seems to be a combination of catalina, the python version, and or pygame version. Also, I think using a virtualenv helps solve the issue.

Could you tell me what python and pygame versions you used, and if you used a virtualenv?

Sorry I haven't replied sooner, couldn't get my hands on a Mac for a long time.

theg3ntlem4n commented 4 years ago

No problem, take your time! I am using Python 3.7.7 and Pygame 1.9.6 and I did not use a virtual env. Hope my response answers your questions.

otj202 commented 3 years ago

I had the exact same problem and used a virtual env, which completely solved the problem.

ahira-justice commented 2 years ago

Fixed

See https://github.com/ahira-justice/chess-board/pull/5#issuecomment-1030420625