1. Installation of the PyInstaller library
1. General installation steps:
The general installation method of pip install pyinstaller is to enter in the cmd command prompt environment:
window+r run cmd
Enter the following to switch to the pip directory
Type pip install pyinstaller
2. Install PyInstaller using python
open python settings
item added
Search for installation packages
The installation is complete
Second, the use of pyinstaller
Open the cmd command prompt and switch to the pyinstaller directory
Enter pyinstaller.py -F filename.py (the file needs to be in the pyinstaller directory)
This file is packaged into an exe file
2.1, PyInstaller command line options
parameter | illustrate |
-F | Generate a single executable |
-D | produces a directory (containing multiple files) as an executable program |
-a | Does not include Unicode character set support |
-in | -w Specifies that the program runs without displaying the command line window (only valid for Windows) |
-c | Specifies to use the command line window to run the program (only valid for Windows |
-O | Specifies the build directory for spec files. If not specified, the current directory is used by default to generate the spec file |
-p | Sets the path to Python imported modules (similar to setting the PYTHONPATH environment variable). You can also use a path separator (semicolon on Windows, colon on Linux) to separate multiple paths |
-n | Specifies the project (generated spec) name. If this option is omitted, the name of the main file of the first script will be used as the name of the spec |
-i | Specifies the icon for executables on Windows/Mac platforms. |
The above is the whole content of this time. There are actually more advanced operations about pyinstaller packaging. You can read more about the official documentation, mainly the command line parameters and the configuration points in the spec file .