我使用python2.7,py2exe,pyqt4并希望像dropbox一样生成安装程序文件。这是我的setup.py文件
# coding=utf8
from distutils.core import setup
import py2exe
import sys, os
sys.argv.append('py2exe')
py2exe_options = {
"includes": ["sip",'encodings', 'encodings.*'],
"dll_excludes": ["MSVCP90.dll", 'OLEAUT32.dll', 'USER32.dll', 'IMM32.dll', 'SHELL32.dll', 'ole32.dll', 'WINMM.dll', 'USER32.dll', 'EKRNEL32.dll', 'ADVAPI32.dll', 'COMDLG32.dll', 'WS2_32.dll', 'WINSPOOL.DRV', 'GDI32.dll', 'KERNEL32.dll'],
"compressed": 1,
"optimize": 2,
"ascii": 0,
"bundle_files": 1
}
setup(
name='IP',
version='1.0',
zipfile = None,
windows=["main.py"],
options={'py2exe': py2exe_options}
)
我想通过运行'python setup.py py2exe'来生成安装,但是失败了。 如何生成安装程序?
答案 0 :(得分:1)
Single Executive File
或Installer
?
您的代码似乎将所有代码打包在一个文件中。
如果您需要Installer
,可以将Single Executive File
传递给某些程序,例如 Inno setup ,以生成安装程序。