参考:https://jingyan.baidu.com/article/a378c960b47034b3282830bb.html

https://ask.csdn.net/questions/720080

https://blog.csdn.net/solarnanocar/article/details/82077484(如果不需要转化成单个exe文件,单单此条即可,亲测有效)

https://www.cnblogs.com/gopythoner/p/6337543.html

https://jingyan.baidu.com/article/bad08e1ed173d409c85121f8.html

需打包程序参考:https://www.cnblogs.com/msxh/p/4966899.html

D:\pythonWorkspace\test>pyinstaller.exe -F -w testa.py
INFO: PyInstaller: 3.4
INFO: Python: 3.7.
INFO: Platform: Windows--10.0.-SP0
INFO: wrote D:\pythonWorkspace\test\testa.spec
INFO: UPX is not available.
INFO: Extending PYTHONPATH with paths
['D:\\pythonWorkspace\\test', 'D:\\pythonWorkspace\\test']
INFO: checking Analysis
INFO: Building because D:\pythonWorkspace\test\testa.py changed
INFO: Initializing module dependency graph...
INFO: Initializing module graph hooks...
INFO: Analyzing base_library.zip ...
INFO: running Analysis Analysis-.toc
INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by d:\python\python.exe
INFO: Caching module hooks...
INFO: Analyzing D:\pythonWorkspace\test\testa.py
INFO: Processing pre-find module path hook distutils
INFO: Loading module hooks...
INFO: Loading module hook "hook-distutils.py"...
INFO: Loading module hook "hook-encodings.py"...
INFO: Loading module hook "hook-pkg_resources.py"...
INFO: Processing pre-safe import module hook win32com
INFO: Loading module hook "hook-pydoc.py"...
INFO: Loading module hook "hook-pygame.py"...
WARNING: Hidden import "pygame._view" not found!
INFO: Loading module hook "hook-pythoncom.py"...
INFO: Loading module hook "hook-pywintypes.py"...
INFO: Loading module hook "hook-sysconfig.py"...
INFO: Loading module hook "hook-win32com.py"...
INFO: Loading module hook "hook-xml.py"...
INFO: Looking for ctypes DLLs
INFO: Analyzing run-time hooks ...
INFO: Including run-time hook 'pyi_rth_pkgres.py'
INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
INFO: Looking for dynamic libraries
INFO: Looking for eggs
INFO: Using Python library d:\python\python37.dll
INFO: Found binding redirects:
[]
INFO: Warnings written to D:\pythonWorkspace\test\build\testa\warn-testa.txt
INFO: Graph cross-reference written to D:\pythonWorkspace\test\build\testa\xref-testa.html
INFO: checking PYZ
INFO: Building because toc changed
INFO: Building PYZ (ZlibArchive) D:\pythonWorkspace\test\build\testa\PYZ-.pyz
INFO: Building PYZ (ZlibArchive) D:\pythonWorkspace\test\build\testa\PYZ-.pyz completed successfully.
INFO: checking PKG
INFO: Building because toc changed
INFO: Building PKG (CArchive) PKG-.pkg
INFO: Building PKG (CArchive) PKG-.pkg completed successfully.
INFO: Bootloader d:\python\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
INFO: checking EXE
INFO: Rebuilding EXE-.toc because testa.exe missing
INFO: Building EXE from EXE-.toc
INFO: Appending archive to EXE D:\pythonWorkspace\test\dist\testa.exe
INFO: Building EXE from EXE-.toc completed successfully.

执行后能在下图路径中的dist文件夹内生成一个exe应用程序,我的是win10系统,经实验,这个应用程序在其他的win10电脑中可以运行,但在win7里不行,若有大神有解决方法,欢迎指点~

D:\pythonWorkspace\test>pyinstaller -D -w testa.py
INFO: PyInstaller: 3.4
INFO: Python: 3.7.
INFO: Platform: Windows--10.0.-SP0
INFO: wrote D:\pythonWorkspace\test\testa.spec
INFO: UPX is not available.
INFO: Extending PYTHONPATH with paths
['D:\\pythonWorkspace\\test', 'D:\\pythonWorkspace\\test']
INFO: checking Analysis
INFO: checking PYZ
INFO: checking PKG
INFO: Bootloader d:\python\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
INFO: checking EXE
INFO: Building because console changed
INFO: Building EXE from EXE-.toc
INFO: Appending archive to EXE D:\pythonWorkspace\test\build\testa\testa.exe
INFO: Building EXE from EXE-.toc completed successfully.
INFO: checking COLLECT
WARNING: The output directory "D:\pythonWorkspace\test\dist\testa" and ALL ITS CONTENTS will be REMOVED! Continue? (y/n)y
INFO: Removing dir D:\pythonWorkspace\test\dist\testa
INFO: Building COLLECT COLLECT-.toc
INFO: Building COLLECT COLLECT-.toc completed successfully.

执行后,可在上图路径中的dist文件夹内生成一个testa文件夹,经压缩后就可发给他人电脑中运行了,我win10的系统发到win7上可以运行

如果有你有其他的素材包,得把素材包复制到新生成的文件夹内,本人还不知道如何把素材包一起转化成单一的exe文件,望有路过的大神指点~

Python | 用Pyinstaller打包发布exe应用的更多相关文章

  1. 用Pyinstaller打包发布exe应用

    有时候编写的Python程序依赖很多,如果要在不同服务器上安装python环境等东西有点得不偿失了.这时候可以使用pyinstaller和py2exe,能够将python程序打包成可执行的exe文件, ...

  2. python用pyinstaller打包成exe文件

    版本为Python2.7 一.安装Pyinstaller 1.安装pywin32 下载安装文件:查找到跟自己适用的python版本及window系统版本匹配的pywin32,下载后安装  使用pip命 ...

  3. 用Pyinstaller打包发布exe应用 (转)经测可用

    安装Pyinstaller   1 按照习惯,我们使用pip来安装模块.我们一直以来强调,要用最偷懒的方法.写代码的人尤其如此.人生苦短,你要偷懒~   0Python | 如何用pip安装模块和包 ...

  4. pyinstaller打包的exe太大?你需要嵌入式python玄学 探索篇

    上篇我们讲到pip的安装以及普通库用pip的安装方法 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 拓展篇​zhuanlan.zhihu.com 问题纷沓而 ...

  5. pyinstaller打包的exe太大?你需要嵌入式python玄学 拓展篇

    上篇我们讲到embedded版本的基础操作 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 惊喜篇​zhuanlan.zhihu.com 可是却没有办法用pi ...

  6. pyinstaller打包的exe太大?你需要嵌入式python玄学 惊喜篇

    上篇讲到 pyinstaller打包exe太大的问题 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 前提篇​zhuanlan.zhihu.com 那既然py ...

  7. pyinstaller打包的exe太大?你需要嵌入式python玄学

    pyinstaller打包一个exe动辄几十M几百M (特别是import pandas以后) 知乎上居然没有人po这方面的”知识“(手动狗头) 查了很多关于reduce pyinstaller打包出 ...

  8. (转!)Pyinstaller 打包发布经验总结

    原文地址 https://blog.csdn.net/weixin_42052836/article/details/82315118 具体的实现图待本人实现后贴上 原 Pyinstaller 打包发 ...

  9. pyinstaller 打包生成exe之后运行提示‘no module name 'xxx'’错误

    python 3.7 pyinstaller 3.4 具体情况: pycharm中点击运行可成功执行,生成正确结果,没有报错. 双击run.py(程序运行的主文件),运行,可生成正确结果,没有报错. ...

随机推荐

  1. 【css基础】html图片右上角加上删除按钮

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  2. Blob, Uint8Aray, atob/btoa in lt IE9 browser

    Blob, Uint8Aray, atob/btoa in lt IE9 browser 标签(空格分隔): compatibility 之前写的代码全部在Chrome调试,用IE打开发现各种问题. ...

  3. [EffectiveC++]item31:将文件间的编译依存关系降至最低

    P143:“声明的依赖性"替换“定义的依存性”

  4. luogu P2124 奶牛美容

    嘟嘟嘟 首先数据范围那么小,那么算法也是相当暴力的. 对于一个点(x, y)所属的联通块,预处理出从这个点出发到这个块外的所有点的曼哈顿距离.复杂度O(n4). 然后求答案:最少答案不一定是三个联通块 ...

  5. ACM/ICPC 2018亚洲区预选赛北京赛站网络赛 B Tomb Raider 【二进制枚举】

    任意门:http://hihocoder.com/problemset/problem/1829 Tomb Raider 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 L ...

  6. mybatis学习记录六——一对一、一对多和多对多查询

    9       订单商品数据模型 9.1     数据模型分析思路 1.每张表记录的数据内容 分模块对每张表记录的内容进行熟悉,相当 于你学习系统 需求(功能)的过程. 2.每张表重要的字段设置 非空 ...

  7. html5中event获取data和class

    获取data和class var tare=$(e.relatedTarget).data("id");var tar=event.target;console.log(tare) ...

  8. HDU 1045 Fire Net(dfs,跟8皇后问题很相似)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1045 Fire Net Time Limit: 2000/1000 MS (Java/Others)   ...

  9. 旧文备份:硬盘MBR引导记录损坏的一种修复方法

    硬盘MBR信息损坏原因:硬盘上安装了windows XP和linux双系统,在windows下安装一套软件,破解的时候修改了硬盘的序列号,结果导致引导系统的grub无法完成linux的引导,只能进到w ...

  10. Linux/Mac scp命令笔记

    scp命令用于Linux之间复制文件和目录. 参数说明: -1: 强制scp命令使用协议ssh1-2: 强制scp命令使用协议ssh2-4: 强制scp命令只使用IPv4寻址-6: 强制scp命令只使 ...