Thanks for the help all, Eric's suggestion led me down a known good path. Following `from _sitebuiltins import _Helper` led me to the fact that this is basically just importing `pydoc` and that the `help` function is `pydoc.help` method. So I added `pydoc` to the `hiddenimports` list in PyInstaller Analysis, and then injected the `pydoc.help` method into the CLI/REPL as `help` methods. This is working well for me in the packaged tool.
On Tuesday, August 10, 2021 at 1:46:53 PM UTC-5 Michael Leonard wrote: > Hi Eric, that seems like a good suggestion, I will give it a try the next > chance I get to package the tool, should be towards the end of this week. > > On Tuesday, August 10, 2021 at 12:56:17 PM UTC-5 [email protected] > wrote: > >> Could a workaround be as simple as just adding an explicit reference to >> the REPL help? >> >> from _sitebuiltins import _Helper >> globals()['help'] = _Helper() >> >> Would this survive processing through pyinstaller? >> >> On Tue, Aug 10, 2021 at 12:11 AM 'Jasper Harrison' via PyInstaller < >> [email protected]> wrote: >> >>> Not currently, no, though if you open a feature request on the GitHub >>> repository I don't see a reason we couldn't add a flag of some kind to not >>> strip it out. >>> >>> Jasper Harrison >>> >>> Core Developer on PyInstaller >>> >>> >>> -------- Original Message -------- >>> On 10 Aug 2021, 09:35, Michael Leonard < [email protected]> wrote: >> >> >>> Hi all, >>> >>> I have searched the internet off and on for a few years without luck >>> trying to find an answer to this question. Is it possible to instruct >>> PyInstaller to ship with Python's built in help() tool and not strip that >>> out? >>> >>> My tool provides both a CLI and GUI REPL which provides users with >>> access to the tool's internals. The classes/functions/methods within the >>> tool are fairly well documented for the most part, but because my users >>> cannot call the built in `help()` function on anything I usually resort to >>> just telling them to download the source files as reference. >>> >>> For example of what I am talking about, here is a snippet from the REPL, >>> showing how I am able to get help on a function when I'm using the >>> 'development' version of my tool, which runs on pure Python: >>> [image: Screen Shot 2021-08-09 at 18.31.56.png] >>> However, attempting the same thing with the 'packaged' version of the >>> tool shows the following error: >>> [image: Screen Shot 2021-08-09 at 18.34.06.png] >>> Is it possible to tell Pyinstaller to keep the Python help function? >>> >>> Thanks, >>> Michael >>> >>> -- >>> 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/43efce1c-e6ba-4ce5-b4c5-4a1fc5bb4805n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/pyinstaller/43efce1c-e6ba-4ce5-b4c5-4a1fc5bb4805n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> -- >>> 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/VWq1jLK8VkyCJ6fdAo6VghopaXfDsacONKPZQYwDEFJ_wiv7YtFTPH_d2Mvula1yVzvT0EJHJCLSmsds-u5grpRspX5F5dCbqlOcjo_RVj4%3D%40protonmail.com >>> >>> <https://groups.google.com/d/msgid/pyinstaller/VWq1jLK8VkyCJ6fdAo6VghopaXfDsacONKPZQYwDEFJ_wiv7YtFTPH_d2Mvula1yVzvT0EJHJCLSmsds-u5grpRspX5F5dCbqlOcjo_RVj4%3D%40protonmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> -- 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/120bd822-d8d8-4c01-a7f9-9230772db098n%40googlegroups.com.
