简体   繁体   中英

Why is my .exe[Made with pyinstaller] says that blessed setupterm(kind=vtwin10),the vtwin10 terminal was not found?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM