在用python开发windows小工具时, 会需要py2exe来打包。 在用py2exe打包时,特别是包含一些特殊的module和package,如pyQT5、lxml、matplotlib、numpy、scipy时,会碰到各种问题。此时可参考py2exe wiki提供的类似于trouble shooting的list,见以下链接: WorkingWithVariousPackagesAndModules - py2exe.org ...
zipfile = None默认py2exe会生成一个library.zip的库文件;此处为None,则不生成改文件,把它打包到exe文件。 "packages": extra_modules指定依赖的其它模块。我用到的beautifulsoup,所以这里指定bs4。这里我用"includes": extra_modules也没问题,没有细究二者的区别。 "bundle_files": 1表示要把所有文件打包成一个...
即使一个很小的py文件,最终生成的exe文件也很大(看安装的库而定,我这里最小4.7M左右),事实上py2exe在打包的时候会把无数的不需要的库都打进来导致最终文件臃肿,如果你安装了很繁杂的库(wxPython等)更是如此。使用zip打包以后查看里面的库文件,把不需要的逐一加入到self.exclude_modules中,最后可以把文件...
--excludes (-e) comma-separated list of modules to exclude --dll-excludes comma-separated list of DLLs to exclude --ignores comma-separated list of modules to ignoreifthey are notfound --includes (-i) comma-separated list of modules to include --packages (-p) comma-separated list of pac...
(None的话使用pygame的默认图标)self.icon_file =None#额外需要拷贝的文件、文件夹(图片,音频等)self.extra_datas =[]#额外需要的python库名self.extra_modules =[]#需要排除的python库self.exclude_modules =[]#额外需要排除的dllself.exclude_dll = ['']#需要加入的py文件self.extra_scripts =[]#打包Zip...
py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序。 py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame,win32com client和server,和其它的独立程序。py2exe是发布在开源许可证下的。
error: [Errno 2] No such file or directory:'C:\Users\Username\AppData\Local\Programs\Python\Python35\lib\site-packages\py2exe\run-py3.5-win-amd64.exe' 21 missing Modules --- ? PIL._i...
"packages": extra_modules指定依赖的其它模块。我用到的beautifulsoup,所以这里指定bs4。这里我用"includes": extra_modules也没问题,没有细究二者的区别。 "bundle_files": 1表示要把所有文件打包成一个 exe可执行程序 3. 生成exe文件 在setup.py目录,执行python setup.py py2exe命令即可。
setup(name='Hello',version='1.0',description='A simple example',author='Magnus Lie Hetland',py_modules=['hello']) py3study 2020/01/06 8310 py2exe打包多个py文件_Python导入包 pythonwindowshttps网络安全 上回在《使用 PyInstaller 打包 Python 程序》中,我们介绍了使用 PyInstaller 对 Python 程序进行...
Modules not found (conditional imports): * _md5 (hashlib) * _sha (hashlib) * _sha256 (hashlib) * _sha512 (hashlib) * com (pkg_resources._vendor.appdirs) * com.sun.jna (pkg_resources._vendor.appdirs) * com.sun.jna.platform (pkg_resources._vendor.appdirs) ...