I recently created an application using pdfkit that takes a keyword entered by the user and makes various internet searches using that keyword. It then uses pdfkit to generate pdf files of each of the separate searches and saves them to a user-defined directory.
Everything works dandy when I run the code from terminal, however when I attempt to freeze the script using py2app, everything works fine up until it comes to actually saving the pdf's, at which the application does absolutely nothing.
I have tried to include both pdfkit and wkhtmltopdf in the setup.py file which py2app uses to create the application, but to no luck, I have tried listing them under the includes section like this:
'includes':['requests','pdfkit']
In the packages section:
'packages':['requests','pdfkit']
and even in the setup_requires section below:
setup_requires=['py2app', 'wkhtmltopdf']
But still the application does nothing. I presume its something to do with the fact that a dependency doesn't get carried over to the frozen application. However I am starting to rethink this as even when I create the app in alias mode (which claims to keep all dependencies), the same problem occurs.
Is this a known issue? Or has anyone found out a solution to this.
Many thanks. My full setup.py file is below:
from setuptools import setup
APP = ['pdtest.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': False, 'includes':['requests','pdfkit'],'packages':['requests','pdfkit'], 'iconfile':'icon.icns'}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app', 'wkhtmltopdf'],
)