I created a small game with pygame and wanted to share it with a friend, therefore i wanted to convert it into a .exe file. I'm using python 3.9.1, pygame 2.0.1 and pyinstaller 4.1 and my os is Win 10.
After trying to run the created exe file no window appears and the console also only appears for a split second.
I read, that pyinstaller may have problem with included files therefore i tested it with a simpler example:
import pygame
pygame.init()
surf = pygame.display.set_mode((600, 600))
while True:
for e in pygame.event.get():
if e.type == pygame.QUIT:
pygame.quit()
break
pygame.display.update()
here i have the same problem, that now window appears, when i run it via cmd the only error i get is <no python frame>
When testing other scripts i got the following error:
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
LookupError: unknown encoding: utf-8
Current thread 0x00001f4c (most recent call first):
<no Python frame>
EDIT
Using pyinstaller with python 3.8.6 seems to work
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…