I am using py2app to create a standalone APP from a python script however I have run into a problem which I am hoping you could help with.
The script relies heavily on tkinter, primarily the tkinter messagebox module, which is not imported with tkinter but rather has to be imported separately using:
from tkinter import messagebox
In my setup.py file that I use to create the application, I have included all the modules that are used in the python, using this code:
from setuptools import setup
APP = ['ch.py']
DATA_FILES = ['company.txt']
OPTIONS = {'argv_emulation': False, 'includes':['tkinter', 'requests', 'os'], 'iconfile': 'icon.icns'}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
However when I compile the app, everything works perfect except the tkinter messageboxes, which simply don't open. I know this is because I have not specifically imported them in the setup.py file.
Does anyone know how I can tell the setup.py file to include "from tkinter import messagebox?