Python | 用Pyinstaller打包发布exe应用
参考: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应用的更多相关文章
- 用Pyinstaller打包发布exe应用
有时候编写的Python程序依赖很多,如果要在不同服务器上安装python环境等东西有点得不偿失了.这时候可以使用pyinstaller和py2exe,能够将python程序打包成可执行的exe文件, ...
- python用pyinstaller打包成exe文件
版本为Python2.7 一.安装Pyinstaller 1.安装pywin32 下载安装文件:查找到跟自己适用的python版本及window系统版本匹配的pywin32,下载后安装 使用pip命 ...
- 用Pyinstaller打包发布exe应用 (转)经测可用
安装Pyinstaller 1 按照习惯,我们使用pip来安装模块.我们一直以来强调,要用最偷懒的方法.写代码的人尤其如此.人生苦短,你要偷懒~ 0Python | 如何用pip安装模块和包 ...
- pyinstaller打包的exe太大?你需要嵌入式python玄学 探索篇
上篇我们讲到pip的安装以及普通库用pip的安装方法 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 拓展篇zhuanlan.zhihu.com 问题纷沓而 ...
- pyinstaller打包的exe太大?你需要嵌入式python玄学 拓展篇
上篇我们讲到embedded版本的基础操作 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 惊喜篇zhuanlan.zhihu.com 可是却没有办法用pi ...
- pyinstaller打包的exe太大?你需要嵌入式python玄学 惊喜篇
上篇讲到 pyinstaller打包exe太大的问题 CodingDog:pyinstaller打包的exe太大?你需要嵌入式python玄学 前提篇zhuanlan.zhihu.com 那既然py ...
- pyinstaller打包的exe太大?你需要嵌入式python玄学
pyinstaller打包一个exe动辄几十M几百M (特别是import pandas以后) 知乎上居然没有人po这方面的”知识“(手动狗头) 查了很多关于reduce pyinstaller打包出 ...
- (转!)Pyinstaller 打包发布经验总结
原文地址 https://blog.csdn.net/weixin_42052836/article/details/82315118 具体的实现图待本人实现后贴上 原 Pyinstaller 打包发 ...
- pyinstaller 打包生成exe之后运行提示‘no module name 'xxx'’错误
python 3.7 pyinstaller 3.4 具体情况: pycharm中点击运行可成功执行,生成正确结果,没有报错. 双击run.py(程序运行的主文件),运行,可生成正确结果,没有报错. ...
随机推荐
- Smart template的控件能否当成普通控件来用
我的同事问过我这个问题: 只要弄清楚Smart control的原理,就能回答这个问题. 答案是: smart control可以像普通的控件一样在xml view中被定义和使用,但是必须结合ODat ...
- csu 1965
Description You are a boss who has N employers. One day, you have a message and you want to tell it ...
- 【洛谷P1801】黑匣子
黑匣子 题目链接 看到题解中“维护两个堆”,突然想到了这道题的解法 维护两个堆:大根堆h1, 小根堆h2 大根堆里的是最小的i个值,小根堆里是剩下的值 每Add一个值时 插入到小根堆中, 再比较小根堆 ...
- Android学习笔记_81_Android ProgressDialog ProgressBar 各种效果
1,弹出Dialog 屏幕不变暗. 创建一个样式就OK了:在styles.xml文件里添加样式: 1, <style name="dialog" parent="@ ...
- 运用Xdebug调试和优化PHP程序
什么是Xdebug? Xdebug是一个开放源代码的PHP程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况.Xdebug现在的最新版本是xdebug 2.0.0beta ...
- lucene&solr学习——创建和查询索引(代码篇)
1. Lucene的下载 Lucene是开发全文检索功能的工具包,从官网下载Lucene4.10.3并解压. 官网:http://lucene.apache.org/ 版本:lucene7.7.0 ( ...
- Vue nodejs商城项目-商品列表页面组件
data(){ return { goodsList:[], // 商品列表 priceFilter:[ // 价格区间数组 ...
- c# 本地完整缓存组件
用了一段时间java,java实现服务端程序很简单,有很多公共开源的组件或者软件.但是c#的很少. 现在准备自己写点东西,学习下新的东西,总结下c#的内容以及我们经常用的内容,抽离成类,组件,模型.方 ...
- Angularjs基础(三)
AngularJS ng-model 指令 ng-model 指令用于绑定应用程序数据到HTML 控制器(input,select,textarea)的值ng-model指令 ng-model指令可以 ...
- Git工作流指南:Gitflow工作流
git工作流 1.Git flow 核心分支:master,dev 可能还会有:功能分支,bug修复分支,预发布分支 2.github flow:只一个长期分支,就是master 第一步:根据需求,从 ...