Pip
Pip is a tool for installing Python packages, typically in the scripts folder in the Python installation directory. If there is a PIP on the computer, open the cmd window, enter the PIP directory, or add this directory to the environment variable, enter
PIP List
You can see the Python packages that have been installed
If not on the computer, you can download a link to the Internet Https://pypi.python.org/pypi/pip
After the download is complete, unzip to a folder, use the CMD console to enter the Extract directory, enter:
Python setup.py Install
Wait for the installation to complete
Pyinstaller
Pyinstaller is a module used to package the program, need to download the official website, download link http://www.pyinstaller.org/downloads.html
The version of Python supported by the current version, and how to install it, are available on the official website.
Download it, unzip it, use CMD to enter the Unzip directory, enter
Pip Install Pyinstaller
In this step my installation process has been a lot of errors, the basic is the lack of modules caused. If the hint is missing distribute, download the website, https://pypi.python.org/pypi/distribute, install with PIP
Pip Install Distribute
If Setuptools, Pywin32 is missing, the installation is also downloaded.
If you still have an error, try entering this
PIP3 Install Pyinstaller
Packaging (Note: When running the command line, be sure to run in the code directory, or you will not be able to open the file after packaging)
Place the program you want to package (that is, the. py file and the referenced resource file) in a folder, enter the directory with CMD, enter
Pyinstaller-f-W XXX. PY
If an error occurs, or if the file is not opened after packing, the first check is in the code directory, and the second command is changed to:
Pyinstaller--hidden-import=queue-w-F $FileName $
Wait for the package to complete, will generate a build folder and a dist folder, exe executable file in the Dist folder, if the program refers to resources, you have to put the resource file in this exe correct relative directory.
If the package is wrong, you can refer to the WarnXXX.txt file in the build folder, which records some warning messages for informational purposes only and does not necessarily identify errors inside.
Windows uses Pyinstaller to package Python3 programs into executable exe files