I've managed to get pyinstaller to run more or less correctly now, except that it opens too many windows. It's pygame project, and it keeps loading the entire thing over again every second or so. My PC fills with game windows after a few seconds and everything grinds to a halt.
Running it from commandline, I can just see print outs saying the app is starting pasted over and over again in commandline window. As far as I can tell the Apps aren't closing or exiting, just spawning more and more.
The command I call to start pyinstaller is this:
pyinstaller --onedir main_local.py
The main file looks like this:
# Library imports
import pygame
# Project imports
from multiroidal_client import MultiroidalClient
from settings import *
import time
# Main program function
def main():
# Initialise game class
game = MultiroidalClient(SCREEN_SIZE, ('127.0.0.1', 8080))
# Start game loop
game.main_game_loop()
# Execute main function
if __name__ == '__main__':
main()
I tried commenting out the if __ name __ ... bit to see if for some reason it was executing the main function and calling a duplicate each time by accident or something. When commented out the exec does nothing, as you might expect.
Any ideas? I've not included any more code because there is loads of it, and I'm not sure which parts are relevant. Let me know if you need to see anything else.
Cheers
EDIT: I added a quick print after the game.main_game_loop() just to check if the script jumped out of the infinite game loop. No such luck. It's loading a parallel instances of the scripts, all running simultaneously.
EDIT: I looked through the pyinstaller docs and managed to get some more debug out. Not sure if it's relevant or not, but here it is. This screen of dialog just keeps reprinting over and over again. I also tried the --noupx option which can sometimes help apparently - no such luck.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…