-
Notifications
You must be signed in to change notification settings - Fork 9
Pyinstaller
Fabio Zito edited this page Feb 24, 2023
·
33 revisions
This is a brief guide to explain our steps to make a binary file from fit.py. For more information about pyinstaller go here
Make sure you have installed FIT on your development machine as explained in the fit repository
Below you find are the steps taken to create an executable on windows 11 whit Git Bash.
-
First you need to install pyinstaller in your poetry virtualenvs. To do this, just to type the command
poetry add pyinstaller
. Currently (version 5.8.0) it's possible after the command you receive the following error. To resolve it just replace the python property in the pyproject.toml file frompython = "^3.9"
topython = ">=3.9,<3.12"
.
- From command promt type:
$ poetry shell
$ pyinstaller .\pyinstaller\windows\fit-console.spec
or
$ poetry shell
$ pyinstaller .\pyinstaller\windows\fit-no-console.spec
- Copy asset directory in the dist dir:
$ cp -r asset/ pyinstaller/windows/dist/
- Go to dist dir and launch fit:
$ cd pyinstaller/windows/dist/
$ ./fit.exe
- If you don't use spec file:
$ poetry shell
$ pyinstaller --noconfirm --onefile --console --clean --additional-hooks-dir=./installer/windows/hooks --icon=../icon.png --specpath=./installer/windows/ --distpath=./installer/windows/dist --workpath=./installer/windows/build fit.py
or
$ poetry shell
$ pyinstaller --noconfirm --onefile --windowed --clean --additional-hooks-dir=./installer/windows/hooks --icon=../icon.png --specpath=./installer/windows/ --distpath=./installer/windows/dist --workpath=./installer/windows/build fit.py