Pyinstaller Official website: http://www.pyinstaller.org/
Official Document: https://pyinstaller.readthedocs.io/en/stable/
Pyinstaller supports Python 2.7 and Python version 3.3+, and supports Windows (xp+), Mac OS X (10.7+), and Linux, but only the corresponding program is compiled on the corresponding system.
1, Pyinstaller Installation
Install directly in cmd (Command prompt)
1 Install Pyinstaller
Wait for Pip to automatically download Pyinstaller, Pefile, Pypiwin32, the future a total of four files and automatically installed, after the installation is completed input
1 Pyinstaller
The output Pyinstaller is used as follows:
1usage:pyinstaller-script.py [-h] [-v] [-d] [-f] [--specpath DIR] [-N NAME]2[-P DIR] [--hidden-Import ModuleName]3[--additional-hooks-dirHookspath]4[--runtime-Hook Runtime_hooks]5[--exclude-module excludes] [--key Key] [-d] [-S]6[--NOUPX] [-c] [-W]7[-I <file.ico or file.exe,id or file.icns>]8[--version-fileFILE] [-M <file or xml>]9[-R RESOURCE] [--uac-admin] [--uac-UIAccess]Ten[--win-private-Assemblies] One[--win-no-prefer-redirects] A[--osx-bundle-identifier Bundle_identifier] -[--distpath DIR] [--workpath Workpath] [-y] -[--upx-dirUpx_dir] [-a] [--Clean ] the[--log-level level] [--UPX UPX] - ScriptName [scriptname ...] -Pyinstaller-script.py:error:the following arguments is Required:scriptname
2, Pyinstaller use
Enter the command directly in CMD:
1 pyinstaller-f-w E:\Programer\Python\scraping\demo3.py
After a series of information and warning output is completed, it will indicate where the generated exe file is stored.
Locate the Directory C:\Windows\system32\dist\ folder (possibly also in the C:\Windows\SysWOW64\dist\ file, estimated to be related to Python 32bit/64bit) to run the generated EXE file
[Options]
-F Generate an EXE single file
-D Generate a folder (default option)
Use Pyinstaller to package python files as exe files