Py2exe downloads in SourceForge only support to 2.7.
For python3.0+ versions, you need to compile them yourself.
1. Download Source
SVN checkout Svn://svn.code.sf.net/p/py2exe/svn/trunk PY2EXE-SVN
2. Compiling environment
The vs2014 is used here.
3. Installation
Enter py2exe-3
This will be compiled and installed.
In addition, Python defaults to the use of VS9, for vs2014, you need to change the file:
Copy Code code as follows:
lib\distutils\msvc9compiler.py
Find:
Copy Code code as follows:
VERSION = Get_build_version ()
Add the following:
Copy Code code as follows:
If an error occurs:
Copy Code code as follows:
Failed to load and parse the manifest. The system cannot find the file specified.
Error:command ' Mt.exe ' failed with exit status 31
Solution: Because the vs2010 after the link.exe parameters slightly changed, so when link did not generate manifest files, natural Mt.exe can not find this file. Only need to search in msvc9compiler.py inside Manifestfile, then add a line above him ld_args.append ('/manifest '), save on OK. (python3.4 doesn't seem to have this problem, 2.7 exists)
4.setup.py
Setup.py can refer to the official website, where the parameters--bundle-files, need to specifically say, want to play into a whole package to set into 0.
Change can refer to: http://sourceforge.net/p/py2exe/svn/HEAD/tree/trunk/py2exe-3/
last attached setup.py
From Distutils.core Import setup
import py2exe
import Sys,os
if sys.version_info.major >= 3.0:
opt_ Bundle_files = 0
Else:
opt_bundle_files = 1
includes = ["Pyqt4.qtcore", "Pyqt4.qtgui", "SIP"]
options = {"Py2exe":
{"Compressed": 1,
"optimize": 2,
"includes": Includes,
"Bundle_files": Opt_bundle_files,
}
}
Setup (
Version = "0.1.0",
description = "Test_add",
options = options,
zipfile=none,
console=[{"script": "test_add.py", "Icon_resources": [(1, "Py.ico")]},
#windows =[{"script": "test_add.py", " Icon_resources ": [(1," Py.ico ")]}],
)