Hi!

I've build a simple GUI using Tkinter which I would like to freeze to a 
standalone executable. I am doing this inside a conda environment. Working 
with OSX 10.15.7, python 3.7, PyInstaller 4.5.1 and conda 4.10.0.

If I create a conda env, import needed modules, set PYTHONPATH and run the 
script like the following, it works perfectly. 

conda create --name imsepcondaenv python=3.7 -y
conda activate imsepcondaenv
pip install tensorflow==1.14 pillow==8.4.0 humanfriendly==10.0 
matplotlib==3.4.3 tqdm==4.62.3 jsonpickle==2.0.0 statistics==1.0.3.5 
requests==2.26.0
conda install -c conda-forge pyinstaller -y
cd ~/Applications/ImSep_files
export PYTHONPATH="$PYTHONPATH:$PWD/ai4eutils:$PWD/cameratraps"
python ImSep/ImSep_GUI.py

However, if I use PyInstaller to make an executable it creates an exe which 
opens the program fine but throws an error when the users starts a process.

[image: Screenshot 2021-11-04 at 17.34.05.png]

I have added the paths to the folders with the --paths flag, but the error 
remains:

conda create --name imsepcondaenv python=3.7 -y
conda activate imsepcondaenv
pip install tensorflow==1.14 pillow==8.4.0 humanfriendly==10.0 
matplotlib==3.4.3 tqdm==4.62.3 jsonpickle==2.0.0 statistics==1.0.3.5 
requests==2.26.0
conda install -c conda-forge pyinstaller -y
cd ~/Applications/ImSep_files
export PYTHONPATH="$PYTHONPATH:$PWD/ai4eutils:$PWD/cameratraps"
cd ImSep
pyinstaller --onefile --name='ImSep' --icon='imgs/logo_small_bg.icns' 
--paths=/Users/peter/Applications/ImSep_files 
--paths=/Users/peter/Applications/ImSep_files/ai4eutils 
--paths=/Users/peter/Applications/ImSep_files/cameratraps 
--paths=/Users/peter/Applications/ImSep_files/cameratraps/detection 
--debug=imports --hidden-import=detection.run_tf_detector --clean 
ImSep_GUI.py

The folder structure looks like this (simplified):
[image: Screenshot 2021-11-04 at 17.27.02.png]

I have messed around with the tips on the When Things Go Wrong page (hooks, 
paths, hidden imports, debugs, latest version etc), but I didn't succeed. 

Does anybody have an idea of what I'm doing wrong?

FYI, if you are on OSX/UNIX you can reproduce the error with the following 
commands. It is a GUI for a model trained by Microsoft to distinguish 
between images with and without animals. 

mkdir ImSep_files
cd ImSep_files
git clone https://github.com/Microsoft/cameratraps -b tf1-compat
git clone https://github.com/Microsoft/ai4eutils
git clone https://github.com/PetervanLunteren/ImSep.git
curl --output md_v4.1.0.pb 
https://lilablobssc.blob.core.windows.net/models/camera_traps/megadetector/md_v4.1.0/md_v4.1.0.pb

 

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/69986ca8-31c3-4b93-9cc1-aab7a75d852cn%40googlegroups.com.

Reply via email to