Pyinstaller with pygame

I searched a lot in the PyInstaller doc to get my own game working. I don’t know much about Ubuntu, but I got everything working in Windows and it should be very similar. The key here is to get PyInstaller to package your ressources (images, sounds, etc.) with your Python code. The best distribution is … Read more

How do I include files with pyinstaller?

Sorry, I thought that only -F/–one-file makes such behavior, but looks like any bundling with pyinstaller needs such changes. You need to change your code like this, as explained in this answer: import sys if getattr(sys, ‘frozen’, False): image = PhotoImage(file=os.path.join(sys._MEIPASS, “files/bg.png”)) else: image = PhotoImage(file=”files/bg.png”) And then bundle it with pyinstaller like this: pyinstaller … Read more

The ‘google-api-python-client’ distribution was not found and is required by the application with pyinstaller

Literally just ran into this issue on windows, whereas macOS is okay. I’m building with fbs and PyQt5. The Problem google-api-python-client is not a python module, but a resource, which means you cannot inject it as a hidden-import. googleapiclient.model reads the distribution info from google-api-python-client folder as a packaged resource. Your full error might look … Read more

How to install python application with tkcalendar module by pyinstaller?

The issue does not come from tkcalendar but from the fact that PyInstaller does not detect second level imports. A way to solve this issue is explained in tkcalendar’s documentation in the HowTos section: When bundling an application with PyInstaller, there is an issue with the detection of the babel dependency of tkcalendar. This can … Read more

Kivy: compiling to a single executable

Based on the links provided by KeyWeeUsr (Bundling data files with PyInstaller and Using PyInstaller to make EXEs from Python scripts) and combining that with Kivy’s resource path method, here’s a workable solution. I feel it’s a bit rough around the edges because it uses SYS._MEIPASS (I would prefer a public API) and requires adding … Read more