[Python Kivy] How to create an exe file with pyinstaller

Create a SPEC file from the py file with pyinstaller (this time the py file is main.py and the kv file is test.ky).

pyinstaller main.py

When executed, a file called main.spec will be created in the working directory. I will modify this SPEC file this time.

Open the file and first insert the following statement on the first line:

from kivy.deps import sdl2, glew

Then, add Tree ('.'), * [Tree (p) for p in (sdl2.dep_bins + glew.dep_bins)] </ font> as follows. , Modify name to kv filename.

coll = COLLECT(exe,Tree('.'),
         a.binaries,
         a.zipfiles,
         a.datas,
         *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
         strip=False,
         upx=True,
         name='test')

Then again with pyinstaller, this time create an exe file using the SPEC file.

pyinstaller main.spec

Then, a folder called test is created in a folder called dist, and the exe file is contained in it.

Recommended Posts

[Python Kivy] How to create an exe file with pyinstaller
How to convert Python to an exe file
Create an Excel file with Python3
How to read an Excel file (.xlsx) with Pandas [Python]
Quickly create an excel file with Python #python
How to create a heatmap with an arbitrary domain in Python
How to create a JSON file in Python
How to crop an image with Python + OpenCV
How to create a multi-platform app with kivy
Creating an exe file with Python PyInstaller: PC freezes in parallel processing
How to measure mp3 file playback time with python
How to turn a .py file into an .exe file
PyInstaller memorandum Convert Python [.py] to [.exe] with 2 lines
How to create an image uploader in Bottle (Python)
[Python] How to create a 2D histogram with Matplotlib
How to convert an array to a dictionary with Python [Application]
Output to csv file with Python
How to create an email user
How to get started with Python
How to run an app built with Python + py2app built with Anaconda
How to use FTP with Python
How to calculate date with python
[Python] How to output a pandas table to an excel file
Make Scrapy an exe with Pyinstaller
How to create an ISO file (CD image) on Linux
How to use NUITKA-Utilities hinted-compilation to easily create an executable file from a Python script
How to create a config file
Create an executable file (EXE) by PyInstaller in a hybrid environment (Nimporter) of Python + Nim
How to get the directory where the EXE built with Pyinstaller exists
[Python] Explains how to use the format function with an example
How to use an external editor for Python development with Grasshopper
[ROS2] How to play a bag file with python format launch
[For Python] Quickly create an upload file to AWS Lambda Layer
Python script written in PyTorch is converted to exe with PyInstaller
[Python] How to convert db file to csv
python3 How to install an external module
How to create * .spec files for pyinstaller.
[Kivy] How to install Kivy on Windows [Python]
Automatic update method with python Pyinstaller exe
How to create an NVIDIA Docker environment
How to work with BigQuery in Python
How to display python Japanese with lolipop
Create Excel file with Python + similarity matrix
[Python] Quickly create an API with Flask
Create an English word app with python
[Python] How to deal with module errors
How to install python3 with docker centos
Create an upgradeable msi file with cx_Freeze
3. Natural language processing with Python 1-2. How to create a corpus: Aozora Bunko
How to upload with Heroku, Flask, Python, Git (4)
How to create sample CSV data with hypothesis
How to enjoy programming with Minecraft (Ruby, Python)
[REAPER] How to play with Reascript in Python
How to do multi-core parallel processing with python
Create an app that guesses students with python
Send an email to Spushi's address with python
How to use Python Kivy ④ ~ Execution on Android ~
How to create an OCF compliant resource agent
[Automation] Convert Python code into an exe file
How to read an array with Python's ConfigParser
Develop Windows apps with Python 3 + Tkinter (exe file)