S
S
Sergey2021-12-11 20:41:55
Python
Sergey, 2021-12-11 20:41:55

Why did the exe file stop compiling in Pyinstaller?

I did a simple python tutorial. She compiled. Then she stopped.
What am I doing wrong? After all, everything worked out :-(

PS C:\Users\sergey\desktop> Pyinstaller -F -w -i"C:\Users\sergey\Desktop\favicon.ico" stars.py
94 INFO: PyInstaller: 4.0.dev0+9dd34bdfba
94 INFO: Python: 3.8.0
94 INFO: Platform: Windows-10-10.0.19041-SP0
96 INFO: wrote C:\Users\sergey\desktop\stars.spec
99 INFO: UPX is not available.
100 INFO: Extending PYTHONPATH with paths
['C:\\Users\\sergey\\desktop', 'C:\\Users\\sergey\\desktop']
100 INFO: checking Analysis
148 INFO: checking PYZ
180 INFO: checking PKG
187 INFO: Building because C:\Users\sergey\desktop\build\stars\stars.exe.manifest changed
187 INFO: Building PKG (CArchive) PKG-00.pkg
3555 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
3561 INFO: Bootloader c:\users\sergey\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
3561 INFO: checking EXE
3564 INFO: Rebuilding EXE-00.toc because pkg is more recent
3564 INFO: Building EXE from EXE-00.toc
3568 INFO: Copying icons from ['C:\\Users\\sergey\\Desktop\\favicon.ico']
3569 INFO: Writing RT_GROUP_ICON 0 resource with 20 bytes
3569 INFO: Writing RT_ICON 1 resource with 4136 bytes
3574 INFO: Updating manifest in C:\Users\sergey\desktop\build\stars\runw.exe.llopwbj0
3575 INFO: Updating resource type 24 name 1 language 0
3579 INFO: Appending archive to EXE C:\Users\sergey\desktop\dist\stars.exe
3591 INFO: Building EXE from EXE-00.toc completed successfully.
PS C:\Users\sergey\desktop>


the source code of the program itself
import random
import pygame
pygame.init()

display_x=1920
display_y=1080
pygame.display.set_caption("Звездное небо")
window=pygame.display.set_mode((display_x,display_y),pygame.FULLSCREEN)
sky_color=(10, 0, 130)
window.fill(sky_color)

big_star=pygame.image.load("big_star.png")
medium_star=pygame.image.load("medium_star.png")
small_star=pygame.image.load("small_star.png")

def delta_sky():
  window.fill(sky_color)
  for i in range(45):
    window.blit(small_star,(random.randrange(0, display_x, 50),random.randrange(0, display_y, 50)))
  for i in range(15):
    window.blit(medium_star,(random.randrange(0, display_x, 50),random.randrange(0, display_y, 50)))
  for i in range(5):
    window.blit(big_star,(random.randrange(0, display_x, 50),random.randrange(0, display_y, 50)))
  pygame.display.flip()

  
my_font=pygame.font.SysFont('arial',24) #шрифт
intro_text_1="Нажимай пробел, чтобы расположить звезды на иной лад!"#текст

intro_color=(240, 230, 100)#цвет текста
rules=my_font.render(intro_text_1,1,intro_color,sky_color)#надпись шрифтом
window.blit(rules,(20,50))#размещение надписи

intro_text_2="(надоест - жми Escape) ^_^'"#текст
rules=my_font.render(intro_text_2,1,intro_color,sky_color)#надпись шрифтом
window.blit(rules,(20,100))#размещение надписи
pygame.display.flip()#обновление экрана

intro_text_3="OST: Sonicarcade - sonic electronic DJ SKy 8 BiT ReMiX"#текст
rules=my_font.render(intro_text_3,1,intro_color,sky_color)#надпись шрифтом
window.blit(rules,(20,150))#размещение надписи

ost=pygame.mixer.music.load("trek.ogg")
pygame.mixer.music.play(-1)
#py.mixer.music.set_volume(0.1)


#главный цикл и выход
run=True
while run:
  for event in pygame.event.get():
    if event.type==pygame.QUIT: run=False
    if event.type == pygame.KEYDOWN: #управление
      if event.key == pygame.K_SPACE:
        delta_sky()
      if event.key == pygame.K_ESCAPE:
        run=False
pygame.quit()

P.S: Сборка проектов - экзотический тег, поэтому добавил тег PYTHON - так будет легче, и мне, и другим.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andy_U, 2021-12-12
@Andy_U

Search google for how to add external files to the exe generated by PyInstaller and about sys._MEIPASS - a variable indicating where to look for these files. Or directly on this site. Standard issue.

R
rPman, 2021-12-11
@rPman

3579 INFO: Appending archive to EXE C:\Users\sergey\desktop\dist\stars.exe
3591 INFO: Building EXE from EXE-00.toc completed successfully.
at the end it says that everything is ok, maybe you are looking for exe in the wrong place?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question