Python: pyinstaller打包exe(含file version信息)
1. 安装pyinstaller

2. 设置文件版本信息

1. 进入cmd界面
2. 将目录转移到C:\ProgramData\Anaconda3\Lib\site-packages\PyInstaller\utils\cliutils\下
3. 拷贝一个要获取版本信息的exe文件到这个目录下
4. 在cmd窗口键入:python grab_version.py filename.exe
5. 目录下会自动出现一个标准的file_version_info.txt文件,双击打开,按照相应的需求修改
6. 在cmd窗口键入:python set_version.py file_version_info.txt youfilename.exe即可
在打包的时候就已经准备好了版本信息文件:file_version_info.txt
打包时用此参数--version-file 即可:pyinstaller --version-file file_version_info.txt test.py

3. 运行pyinstaller来打包exe


4. 打包exe过程中遇到的问题:

- 先查询机器是上否有安装pyqt以及文件夹,可以用Anaconda Prompt中输入conda list来查看机器上的pyqt的版本以及路径信息(同理,也可以用Everything来查询此dll文件来定位到文件夹路径)。






Python: pyinstaller打包exe(含file version信息)的更多相关文章
- python pyinstaller 打包exe报错
今天用python 使用pyinstaller打包exe出现错误 环境pyqt5 + python3.6 在导入pyqt5包之前加上如下代码 import sysimport osif hasattr ...
- python pyinstaller打包exe暗坑1
环境 python2.7.9 win-xp 今天打包了一个小脚本,结果打开报错
- pyinstaller 打包exe程序读不到配置文件No such file
挺久没更新博客的,一来之前是觉得才疏学浅,记录下来的太简单没人看.二来时间上不是很充裕(不是借口,有时间打游戏,没时间总结) 偶然有一次发现同事在搜索解决问题的时候正在看我博客的解决思路,很奇妙的感觉 ...
- 利用PyInstaller打包exe文件
前言 平常我们通过Python写完一些小脚本之后,如果使用不频繁的话,一般会选择在DOS界面直接跑脚本,或者在IDE中运行.但当我们需要频繁使用某些脚本,或者在没有Python环境的机器上也能顺利运行 ...
- Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案
最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...
- Pyinstaller打包exe,丢失图标等问题
Pyinstaller打包exe,丢失图标等问题 一.原因 exe运行时会解压一个名为'_MEI*'的资源文件夹到电脑的临时目录,程序结束时删除. 程序里使用'\图标.png'这样的路径,exe运行时 ...
- pyinstaller打包exe文件,运行时一闪而过
pyinstaller打包exe文件出现命令窗口一闪而过 原因:exe运行过程中出错了,解决这些错误就可以了 解决方法: 通过 cd path >> xxx.exe 在命令行中运行exe文 ...
- pyinstaller打包exe文件闪退的解决办法
pyinstaller是python下目前能打包py文件为windows下的exe文件的一个非常友好易用的库!但是,小爬每次用pyinstaller打包时也总是遇到一些难题,有时网上搜了一圈,也没看到 ...
- Pyinstaller 打包exe
安装 pip insatll Pyinstaller 参数 pyinstaller -Fw main.py 参数 概述 -F,-onefile 打包一个单个文件,如果你的代码都写在一个.py文件的 ...
随机推荐
- Python3 bytes 函数
Python3 bytes 函数 Python3 内置函数 描述 bytes 函数返回一个新的 bytes 对象,该对象是一个 0 <= x < 256 区间内的整数不可变序列.它是 b ...
- 判断UNITY版本号
代码示例: #if (UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7 || UNITY_5_8 || UNITY_5_9)u ...
- leetcdoe 175. Combine Two Tables
给定两个表,一个是人,一个是地址,要求查询所有人,可以没有地址. select a.FirstName, a.LastName, b.City, b.State from Person as a le ...
- 【校招面试 之 剑指offer】第10-1题 斐波那契数列
递归以及非递归实现: #include<iostream> using namespace std; long long fun(long long n){ if(n == 0){ ret ...
- OptionParser模块学习
from optparse import OptionParser import sys useage = [] test_parser = OptionParser(usage="%pro ...
- boost x64 lib
libboost_atomic-vc150-mt-gd-x64-1_66.liblibboost_atomic-vc150-mt-s-x64-1_66.liblibboost_atomic-vc150 ...
- nginx 反向代理 502 Bad Gateway
查看nginx的error.log日志文件发现如下信息: upstream sent too big header while reading response header from upstrea ...
- WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [] milliseconds.
编译安装tomcat-native和tomcat-deamon以后,发现toomcat启动很慢,好久才有响应.以下日志供参考: 11-Sep-2017 12:19:28.102 INFO [main] ...
- OpenGLES.APPLE_texture_format_BGRA8888
OpenGL ES的扩展: APPLE_texture_format_BGRA8888 http://www.khronos.org/registry/gles/extensions/APPLE/AP ...
- CString 作为参数执行都不执行
static int LoadUsbSDK(CString curpath ) win10系统下 CString 函数加载dll直接跳过 加载dll最好不要带参数