Closed ThePieBandit closed 4 years ago
Could you please share your .spec
file. I have a suspicion that it may need to be specified in the .spec
file exactly where to look for _tkinter
in the analysis tree, likein the documentation here: https://pyinstaller.readthedocs.io/en/stable/spec-files.html.
PS, to confirm, this executable is intended to run on Linux yes?
Spec file is available here, as is my project: https://github.com/ThePieBandit/TCG-to-Deckbox/blob/releaseActions/src/tcg-to-deckbox.spec. I've tried entering tkinter
and _tkinter
to no effect
I am trying to run this on linux, eventually I plan on using your other repo to have a github action create a windows executable as well
My understanding is that tkinter is supposed to be a built in python module, but admittedly I'm pretty new at python.
This was a real doozy in the end!
Turns out that Linux doesn't have the binaries for Tkinter by default, and thus you must install them before installing Python.
I've added an argument now that will uninstall Python, install the Tkinter binaries, and install Python again if the user has specified tkinter
to be true in their action.yml. This can be seen in release 0.1.4 https://github.com/JackMcKew/pyinstaller-action-linux/releases/tag/0.1.4.
I forked your example repo until I got it working, for which you can see it successfully packaging here: https://github.com/JackMcKew/TCG-to-Deckbox/actions/runs/229445716
I don't have a linux machine ready at the moment, so it is unverified whether the application works as intended.
I hope this has fixed the issue for you, and I'm unsure whether the Windows pyinstaller action will behave similarly, but please raise an issue if it does.
Unfortunately, it still isn't working. I can see your github action doing more things like installing tk, but I still don't see pyinstaller picking it up.
https://github.com/ThePieBandit/TCG-to-Deckbox/actions/runs/229650750
Ah thank you for raising this again. The error was due to .bashrc
not being sourced correctly and the Github Action user not being able to access Pyenv to recompile Python after Tkinter was installed.
I have now fixed this as you can see in this runtime (https://github.com/JackMcKew/TCG-to-Deckbox/runs/1044598608?check_suite_focus=true), note the line within the Pyinstaller Linux
step:
4073 INFO: Loading module hook 'hook-_tkinter.py' from '/root/.pyenv/versions/3.7.5/lib/python3.7/site-packages/PyInstaller/hooks'...
Since this dramatically slows down the action (from uninstalling Python, install Tkinter and recompiling Python), I've decided to leave this on a separate branch of the action. This can be used by specifying the tkinter branch (eg JackMcKew/pyinstaller-action-linux@tkinter
).
Note that I still cannot 100% test that this is fully working on a linux machine, but I believe this is a step in the right direction. Please close the issue if this has solved this problem for you 👍
PS, I also tested on the Windows pyinstaller action which did not have this amount of trouble, please find the logs: https://github.com/JackMcKew/TCG-to-Deckbox/runs/1044515031?check_suite_focus=truehttps://github.com/JackMcKew/TCG-to-Deckbox/runs/1044515031?check_suite_focus=true
Looks like it works! I tested the app you built and no errors are raised.
Fantastic! Thank you for raising this
Describe the bug I have a python script that uses tkinter to provide a simple file dialog and message box. When I test and build locally with pyinstaller to generate the spec file, the executable works fine. building in the github action succeeds, but the executable created doesn't work, giving the error:
To Reproduce I ran with the following github action flow
successful.log failure_logs_17.zip
As you'll note from the attached logs, the one where the executable functions has the line
3120 INFO: Loading module hook 'hook-_tkinter.py' from '/home/rspremulli/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
while the github action doesn't. Is there some issue why it won't load the tkinter module?