From b0c35e358341bfe7f5a2daf828f3fd5d1396a0c3 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Tue, 19 Apr 2022 17:21:02 -0400 Subject: [PATCH] Updated Troubleshooting (markdown) --- Troubleshooting.md | 50 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/Troubleshooting.md b/Troubleshooting.md index a09aaeb..7ab1e43 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -183,4 +183,52 @@ apprise -vv -t "Multi-line Variable Example" -b "$MULTILINE_VAR" \ # Note: to preserve the new lines, be sure to wrap your # variable in quotes (like example does above). -``` \ No newline at end of file +``` + +## Pyinstaller Support +[Pyinstaller](https://pyinstaller.org/) allows to package a python application with its dependencies in a single exe. + +It is possible to package an application that is using Apprise but there is a trick. + +Let's take a simple script : + +```python +import apprise +apobj = apprise.Apprise() +apobj.add(':///') +apobj.notify(title="a title", body="this is the body of the notification") +``` + +Then package with pytinstaller : + +```shell +pyinstaller -F myscript.py +``` + +And launch it + +```shell +./dist/myscript +``` + + +We get + +```shell +FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIEbGkgo/apprise/attachment' +or +FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIEbGkgo/apprise/plugins' +or +FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIEbGkgo/apprise/config' +``` + +We have to use `--collect-all` option which, according to documentation : + +> Collect all submodules, data files, and binaries from the specified package or module. This option can be used multiple times. + +```shell +pyinstaller -F --collect-all apprise myscript.py +``` + +No more errors, notifications are sent. +