- To run the graphical interface, run with
pythonw(and notpython). On Windows, both seem to work. - To force the command line interface, run with the
--ignore-gooeyflag.
-
Start with a minimal environment (miniconda3 works OK).
-
Note that in Anaconda on Windows the default numpy is compiled against MKL, which is huge. Instead, install the numpy that works with OpenBLAS, as suggested here.
conda create -n openblas python=3.8 conda activate openblas conda install conda-forge::blas=*=openblas conda install -c conda-forge numpyApparently, installing with pip also works (and is often recommended when using Pyinstaller).
-
Install the rest of the relevant packages (pandas, openpyxl, gooey, pyinstaller).
-
Generate a build spec with:
pyi-makespec --windowed --onefile --collect-submodules openpyxl od_normalizer.pyNB 1:
--collect-submodules openpyxlwas added since some of its necessary submodules were missing in previous builds and led to crashes.NB 2:
--onefileis better for distribution, but may be slower on start up, and hides the imports (if debugging the build is required). Alternatively can build with--onedir. -
Download and extract UPX (optional, reduces EXE size).
-
Run pyinstaller with:
pyinstaller -y --upx-dir=C:\dev\upx-4.2.3-win64 od_normalizer.spec