python3打包碰到问题

cx_1226 2017-10-13 11:14:17
学了python编了一两个爬虫,准备将某个脚本打包,但是一直报错,折腾好久了,求大神指点:
打包源代码如下:

from distutils.core import setup
import py2exe
import sys

#this allows to run it with a simple double click.
sys.argv.append('py2exe')

py2exe_options = {
#"includes": ["sip"],
"dll_excludes": ["MSVCP90.dll",],
"compressed": 1,
"optimize": 2,
"ascii": 0,
"bundle_files": 1,
}


setup(
name = 'sample',
version = '1.0',
windows = ['sample.py',],
data_files=[("",
[r"C:\Python33\Lib\site-packages\PyQt5\libEGL.dll"]),
("platforms",
[r"C:\Python33\Lib\site-packages\PyQt5\plugins\platforms\qwindows.dll"])],
zipfile = None,
options = {'py2exe': py2exe_options}
)




这样下来在cmd中运行总是报错:
ImportError:source not available through get_data()

在python 自带的IDLE里编辑就会显示:
running py2exe
Building 'dist\sample.exe'.

但是点开dist文件,文件下是空白,没有应该有的exe文件。

小白实在是不知道怎么解决了,求教各位大神指点!
...全文
155 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cx_1226 2017-10-19
  • 打赏
  • 举报
回复
引用 1 楼 QuantumEnergy 的回复:
试试pyinstaller
好的,那我去试试。
QuantumEnergy 2017-10-14
  • 打赏
  • 举报
回复
试试pyinstaller

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧