Issue
hello I made a chess bot with python inside a virtualenv my bot uses blessed to color the boards it displays using pyinstaller I ran the command pyinstaller random_move_chessbot.py --onefile
on my cmd, It generated the exe file but when I ran the file it displayed a error an error saying blessed\terminal.py:186: UserWarning: Failed to setupterm(kind='vtwin10'): Could not find terminal vtwin10
.
Can anyone tell me why this happens?
Thanks in advance...
from random import *
import chess
import blessed
board = chess.Board()
term = blessed.Terminal()
run = True
print('Your playing white')
def blackmove():
black_moves = board.legal_moves
black_moves = list(black_moves)
bmove = randint(0, len(black_moves))
black_move = black_moves[bmove]
board.push(black_move)
print('To exit write "exit"')
while run:
white_move = input('Enter Move:')
if white_move == 'exit':
run = False
exit()
board.push_san(white_move)
print(term.yellow("White's Turn"))
if board.is_check == True:
print(f'{term.red}{board}{term.normal}')
else:
print(f'{term.blue}{board}{term.normal}')
blackmove()
print(term.yellow("Black's Turn"))
if board.is_check == True:
print(f'{term.red}{board}{term.normal}')
else:
print(f'{term.green}{board}{term.normal}')
if board.is_checkmate == True or board.is_stalemate == True:
run = False
print(board)
print(board.result)
exit = False
while exit != True:
a = input('Exit[y/n]:')
match a:
case 'y':
exit = True
case 'n':
pass
Solution
Looks like I found how to fix this;
you have to enter this command so that will import the vtwin10 terminal in the jinx library
pyinstaller --hidden-import=jinxed.terminfo.vtwin10 --onefile test.py
Answered By - Sasen Perera
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.