-
Notifications
You must be signed in to change notification settings - Fork 411
Developers: Creating Executable Builds for Pyfa
Alex Jones edited this page Nov 25, 2019
·
6 revisions
Currently builds are not done using pyInstaller
. This is simply documenting one method to creating builds.
You will need to modify the pyfa.spec
file. This file should always be executed from the same level as pyfa.py
.
pathex=['C:\\Users\\Ebag333\\Documents\\GitHub\\Ebag333\\Pyfa'],
pathex
points to where your pyfa.py
and pyfa.spec
file lives.
icon='C:/Users/Ebag333/Documents/GitHub/Ebag333/Pyfa/dist_assets/win/pyfa.ico',
icon
can be found twice. Modify both locations. Make sure to point to the correct distribution icon.
debug=False,
console=False,
By default we don't show the console or output debugging info. If the build does not run, you may need to enable these to troubleshoot.
- Install Linux (steps below use Ubuntu as a reference)
- Escalate to su
sudo su
or prepend all commands below withsudo
- Update apt-get:
apt-get update
- Install python3 if not already installed (3.6 needed)
- Install pip3
apt-get install python3-pip python3-dev build-essential
pip3 install --upgrade pip3
pip3 install --upgrade virtualenv
- Install wxPython.
apt-get install python-wxgtk3.0 python-wxgtk3.0-dev
- Create a directory to place the build files. (I used
/tmp/Pyfa_build
) - Change directory to the one you created above.
- Upload all files into the directory (can be done via git or simply copying the files)
- Install Pyfa requirements.
If you get any memory errors, use--no-cache-dir
. If you get build errors ("python setup.py egg_info" failed
) try installinglibfreetype6-dev
.
pip3 install -r requirements.txt
apt-get install libfreetype6-dev
pip3 --no-cache-dir install -r requirements.txt
- From within the same directory as
pyfa.py
andpyfa.spec
run:pyinstaller --clean --noconfirm --windowed pyfa.spec
- Because Linux doesn't bundle all the libraries in the package, it may not be backwards compatible. It should be forward compatible, but it's recommended to build on the oldest version you want to support.
.
- Install Windows (steps below use Windows 10 as a reference)
- Install python if not already installed (2.7 recommended
- Install wxPython (version 2.8)
- Install Visual Studio (there is a free community edition)
- Create a directory to place the build files. (I used
/tmp/Pyfa_build
) - Change directory to the one you created above.
- Upload all files into the directory (can be done via git or simply copying the files)
- Install Pyfa requirements:
pip install -r requirements.txt
pip install -r requirements_build_windows.txt
- From within the same directory as
pyfa.py
andpyfa.spec
run:pyinstaller.exe --clean --noconfirm --windowed --upx-dir=.\scripts\upx.exe pyfa.spec