To tell PyInstaller how to build Luxocator, we must create a specification file, which we will call Luxocator.spec. Actually, the specification file is a Python script that uses a PyInstaller class called Analysis and the PyInstaller functions called PYZ, EXE, and BUNDLE. The Analysis class is responsible for analyzing one or more Python scripts (in our case, just Luxocator.py) and tracing all the dependencies that must be bundled with these scripts in order to make a redistributable application. Sometimes, Analysis makes mistakes or omissions, so we modify the list of dependencies after it is initialized. Then, we zip the scripts, make an executable, and (for Mac) make an app bundle using PYZ, EXE, and BUNDLE, respectively. Here is the implementation:
a = Analysis(['Luxocator.py'],
pathex=['.'],
hiddenimports...