免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7152 | 回复: 6
打印 上一主题 下一主题

使用pyinstaller打包wxPython程序失败 [复制链接]

论坛徽章:
2
拜羊年徽章
日期:2015-03-03 16:15:4315-16赛季CBA联赛之同曦
日期:2018-07-25 19:57:32
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-25 10:44 |只看该作者 |倒序浏览
我个人比较喜欢pyinstaller,因为不需要写代码。顺便做个广告,pyinstaller真不错。

以前一直用它打包普通的代码,都成功了。

我现在想打包wxpython的程序,就失败了:
------------------------------------------------------------

操作系统: XP SP2

Python版本: Python2.6

wxPython版本: wxPython2.8-win32-unicode-2.8.10.1-py26

pyinstaller版本: pyinstaller-1.3

-------------------------------------------------------------

打包后,没出什么大错,就是程序显示不了,双击运行后,出现一个黑框,瞬间消失(我使用了.pyw,应该不会跳出黑框)。这是打包日志:

W: no module named posix (conditional import by os)
W: no module named optik.__all__ (top-level import by optparse)
W: no module named readline (delayed, conditional import by cmd)
W: no module named wxPython.wx (top-level import by __main__)
W: no module named readline (delayed import by pdb)
W: no module named pwd (delayed, conditional import by posixpath)
W: no module named win32api (delayed import by iu)
W: no module named org (top-level import by pickle)
W: no module named posix (delayed, conditional import by iu)
W: no module named fcntl (conditional import by subprocess)
W: no module named org (top-level import by copy)
W: no module named _emx_link (conditional import by os)
W: no module named optik.__version__ (top-level import by optparse)
W: no module named fcntl (top-level import by tempfile)
W: __all__ is built strangely at line 0 - collections (C:\Python26\lib\collections.pyc)
W: delayed  exec statement detected at line 0 - collections (C:\Python26\lib\collections.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc)
W: delayed  exec statement detected at line 0 - doctest (C:\Python26\lib\doctest.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc)
W: delayed  __import__ hack detected at line 0 - encodings (C:\Python26\lib\encodings\__init__.pyc)
W: __all__ is built strangely at line 0 - optparse (C:\Documents and Settings\Gavinwu\桌面\pyinstaller-1.3\optparse.pyc)
W: __all__ is built strangely at line 0 - dis (C:\Python26\lib\dis.pyc)
W: delayed  eval hack detected at line 0 - os (C:\Python26\lib\os.pyc)
W: __all__ is built strangely at line 0 - __future__ (C:\Python26\lib\__future__.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc)
W: __all__ is built strangely at line 0 - tokenize (C:\Python26\lib\tokenize.pyc)
W: __all__ is built strangely at line 0 - wx (C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.pyc)
W: __all__ is built strangely at line 0 - wx (C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.pyc)
W: delayed  exec statement detected at line 0 - bdb (C:\Python26\lib\bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc)
W: delayed conditional exec statement detected at line 0 - iu (C:\Documents and Settings\Gavinwu\桌面\pyinstaller-1.3\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (C:\Documents and Settings\Gavinwu\桌面\pyinstaller-1.3\iu.pyc)
W: delayed  eval hack detected at line 0 - gettext (C:\Python26\lib\gettext.pyc)
W: delayed  __import__ hack detected at line 0 - optik.option_parser (C:\Documents and Settings\Gavinwu\桌面\pyinstaller-1.3\optik\option_parser.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc)
W: __all__ is built strangely at line 0 - optik (C:\Documents and Settings\Gavinwu\桌面\pyinstaller-1.3\optik\__init__.pyc)
W: delayed  exec statement detected at line 0 - pdb (C:\Python26\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc)

论坛徽章:
0
2 [报告]
发表于 2009-06-25 11:01 |只看该作者

回复 #1 Mylib 的帖子

posix是linux内核下的块,windows下的python没这模块

论坛徽章:
2
拜羊年徽章
日期:2015-03-03 16:15:4315-16赛季CBA联赛之同曦
日期:2018-07-25 19:57:32
3 [报告]
发表于 2009-06-25 11:02 |只看该作者
啊,这应该没有关系的吧

论坛徽章:
0
4 [报告]
发表于 2009-06-25 11:11 |只看该作者

回复 #3 Mylib 的帖子

怎么没关系呢。。。。都没这块,你在windows下运行不了,会报importerror

论坛徽章:
2
拜羊年徽章
日期:2015-03-03 16:15:4315-16赛季CBA联赛之同曦
日期:2018-07-25 19:57:32
5 [报告]
发表于 2009-06-25 11:13 |只看该作者
W: no module named wxPython.wx (top-level import by __main__)

我觉得这句有问题,可是我有wxPython模块啊,我用的是最简单的wxpython程序,可以运行的,打包后就不行了。

论坛徽章:
2
拜羊年徽章
日期:2015-03-03 16:15:4315-16赛季CBA联赛之同曦
日期:2018-07-25 19:57:32
6 [报告]
发表于 2009-06-25 11:51 |只看该作者
郁闷,我换成了,2.5版本,可以了

论坛徽章:
0
7 [报告]
发表于 2009-06-25 22:44 |只看该作者
有时打包程序时,可能没有包含所需的程序模块,或者是所需的链接库,都可能导致运行不了的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP