How can I go about compiling the GUI into a .exe file after making changes to the GUI code.
Sincerely,
HPBT-1
How can I go about compiling the GUI into a .exe file after making changes to the GUI code.
Sincerely,
HPBT-1
if your just changing the GUI code you should be able to run app.py from .venv and have the code run. why are you compiling to exe?
We wanted to be able to compile it to help mitigate the chances of a single fault point - if we compile it then we can distribute the .exe file to all computers so in case one fails, another team members laptop can be used.
as far as I know there is not a built in way to compile it to .exe you could do something like this https://datatofish.com/executable-pyinstaller/ to compile
Inside the GUI folder of the repo, there is a build.py
script which compiles the GUI into an .exe.
This uses PyInstaller.
So I have been trying to do this, yet every single time I run it, PyInstaller runs successfully, then when I navigate to the .exe file and run it, a cmd window opens for a fraction of a second then disappears. I have run it for both our modified code and the downloaded AVR repo. I also noticed that it added 2 separate folders “dist” and “build”, however the documentation said I could find the working .exe in “dist”, but running either has the same result. One other thing of note - the size of “dist” or the .exe inside it is significantly lower than the ~64MB of the provided GUI.exe
Do your modifications work when you run app.py
directly and not compiled?
You should be using the .exe file in the dist
folder. The build
folder are temporary files used by PyInstaller as it compiles.
You can run the .exe directly from the command line to see what the output from the console window is before it crashes.
Can’t comment on if the modifications work when I run app.py directly (will reach out to our programming lead and reply when I hear back) but what I do know is that I tried run it in CMD, yet I never got a single message, and when I even tried to add logging into it, the same thing happened. I will upload the “dist” folder in case it helps at all. Will also add that I am on windows if it makes any difference.
in the attached link I went ahead and uploaded the entire AVR-2022-stable file, its not our modified one, just the one straight off of the AVR-2022 github, the .exe file is located under GUI > dist > build then the .exe file is under there. I made it by going into the gui folder using cmd, then running pyinstaller on the build.py script
I downloaded your folder, went into the GUI subfolder, and the dist\app\app.exe
did not run for me. I was able setup a virtual environment, build, and run and executable with no issue:
python -m venv .venv
.venv\Scripts\activate
python -m pip install pip wheel --upgrade
python -m pip install -r requirements.txt
python build.py # if this not a git repo, edit line 12 to just be `"AVRGUI",`
.\dist\AVRGUI.exe
I used Python 3.10.10 on Windows 11.