python3.4
Install the 64-bit version Py2exe
: Https://pypi.python.org/pypi/py2exe/0.9.2.0#downloads
Cmd--> into the pyfile/pyqt5 file directory, dir, execute python setupp.py py2exe
setupp.py
1 #-*-coding:utf-8-*-2 __author__='Yangyang5'3 4 fromDistutils.coreImportSetup5 ImportPy2exe6 ImportSYS7 8 #Setup (Windows = ["index.py"])9 Ten #This allows to run it with a simple double click. OneSys.argv.append ('Py2exe') A -Py2exe_options = { - "includes": ["SIP"],#If there is PYQT code in the package file, this is the one that must be added the "Dll_excludes": ["MSVCP90.dll",],#this must be, or the package after the program run will not find MSVCP90.dll, if the package process can not find this file, please install the appropriate library - "Compressed": 1, - "optimize": 2, - "ASCII": 0, + "Bundle_files": 1,#For This parameter see the question in Part three (2) - } + A Setup ( atName ='PyQt Demo', -Version ='1.0', -Windows = ['index.py',],#change the file name in parentheses to the code you want to package -ZipFile =None, -Options = {'Py2exe': Py2exe_options} -)
Problems encountered:
Unicodedecodeerror: ' GBK ' codec can ' t decode byte 0xaf illegal multibyte sequence
PYQT5 Note (iii) Py2exe implementation code Packaging EXE