python3.4 +pyqt5 +cx_freeze 打包成exe
2015-12-02 15:41
579 查看
1、安装cx_freeze
通过cx_Freeze-4.3.4-cp34-none-win_amd64.whl安装
安装方式:
cmd切换目录:运行 pip3 install cx_Freeze-4.3.4-cp34-none-win_amd64.whl
下载链接:http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
2、编写setup.py文件
#!/usr/bin/env python
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
packages = [
'os'
]
options = {
'build_exe': {'packages': packages, 'include_files': ['setup.properties'], 'icon': 'bus32.ico',
"includes": "atexit"},
}
executables = [Executable('install.py', base=base, targetName='installpay.exe')]
setup(
name="PayInstall",
version="1.0.0",
url='http://pay.dreams.edu.cn/',
author='liuguanghui',
author_email='sunsray@163.com',
description="Install for Pay PlatForm",
options=options,
executables=executables, requires=['PyQt5']
)
3、cmd运行:python3 setup build或者python setup.py bdist_msi打包
4、在其他机器上运行报错:竟然冒出个X:
费尽力气最后找出原因(stackoverflow):
http://stackoverflow.com/questions/24135953/executable-created-using-cx-freeze-in-windows-7-crashes-with-errors-about-pyqt5
上面提出了首先查看这两个dll:QWindows.DLL and libEGL.dll h是否在生成的文件目录里存在
然后:
但发现以上都没解决,
从最后的回答解决了!!将msvcp100.dll拷贝到生成目录里即可
通过cx_Freeze-4.3.4-cp34-none-win_amd64.whl安装
安装方式:
cmd切换目录:运行 pip3 install cx_Freeze-4.3.4-cp34-none-win_amd64.whl
下载链接:http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
2、编写setup.py文件
#!/usr/bin/env python
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
packages = [
'os'
]
options = {
'build_exe': {'packages': packages, 'include_files': ['setup.properties'], 'icon': 'bus32.ico',
"includes": "atexit"},
}
executables = [Executable('install.py', base=base, targetName='installpay.exe')]
setup(
name="PayInstall",
version="1.0.0",
url='http://pay.dreams.edu.cn/',
author='liuguanghui',
author_email='sunsray@163.com',
description="Install for Pay PlatForm",
options=options,
executables=executables, requires=['PyQt5']
)
3、cmd运行:python3 setup build或者python setup.py bdist_msi打包
4、在其他机器上运行报错:竟然冒出个X:
费尽力气最后找出原因(stackoverflow):
http://stackoverflow.com/questions/24135953/executable-created-using-cx-freeze-in-windows-7-crashes-with-errors-about-pyqt5
上面提出了首先查看这两个dll:QWindows.DLL and libEGL.dll h是否在生成的文件目录里存在
然后:
includes': ['atexit']这个必须有
mport sys from cx_Freeze import setup, Executable base = None if sys.platform == 'win32': base = 'Win32GUI' setup(name = 'spamandeggs', version = '0.0.1', executables = [Executable('spamandeggs.pyw', base=base)], options = {'build_exe': {'includes': ['atexit']}})
但发现以上都没解决,
从最后的回答解决了!!将msvcp100.dll拷贝到生成目录里即可
0down vote | I got the same error today, and finally found a solution for me after a whole day of searching. I copied msvcp100.dll, and everything works. wft
|
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法