使用pyinstaller打包后程序无法运行,帮忙诊断,谢谢

eXeSP 2013-05-21 03:53:06
写一个处理excel的程序,使用下面的一些包

#encoding=utf-8
import wx
import os
import xlrd
import xlwt

eclipse运行没问题,用pyinstaller打包过程没ERROR,但是出来的EXE就是运行不了,后来进程也是一闪而过。请问这是什么问题呢

我的打包命令是 (pyinstaller 2.0版本): python pyinstaller.py -F -w CDD2.py

用py2exe也不好用,半道出错,是啥 no attribute 'GOLBAL DEFAULT TIME'
...全文
10545 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
crifan 2013-05-23
  • 打赏
  • 举报
回复
我看着你那句“用pyinstaller打包过程没ERROR”就怀疑你是不是真的没错误。 然后看你的回复,果然是真有错误。 解决办法: 加上: -p youLibPath 让其找到对应的各个lib的路径,就可以自动找到对应的lib,打包进去了。 详见: 【记录】用PyInstaller把Python代码打包成单个独立的exe可执行文件
eXeSP 2013-05-23
  • 打赏
  • 举报
回复
看了一下日志,还是出错很多啊。应该怎么导入包? W: no module named cElementTree (delayed, conditional import by xlrd.xlsx) W: no module named org (delayed import by xml.sax) W: no module named _dummy_threading (top-level import by dummy_threading) W: no module named grp (top-level import by shutil) W: no module named cl (delayed, conditional import by aifc) W: no module named pwd (delayed, conditional import by posixpath) W: no module named org (top-level import by pickle) W: no module named posix (delayed, conditional import by __main__) W: no module named fcntl (conditional import by subprocess) W: no module named pwd (top-level import by shutil) W: no module named java (conditional import by xml.sax._exceptions) W: no module named pwd (top-level import by tarfile) W: no module named readline (delayed import by pdb) W: no module named AES (delayed, conditional import by archive) W: no module named _scproxy (conditional import by urllib) W: no module named grp (top-level import by tarfile) W: no module named posix (delayed, conditional import by iu) W: no module named elementtree (delayed, conditional import by xlrd.xlsx) W: no module named termios (top-level import by getpass) W: no module named pwd (delayed import by getpass) W: no module named org (top-level import by copy) W: no module named fcntl (top-level import by tempfile) W: no module named readline (delayed, conditional import by cmd) W: no module named EasyDialogs (conditional import by getpass) W: no module named cl (delayed import by aifc) W: no module named xmlparse (top-level import by pyexpat) W: no module named xmltok (top-level import by pyexpat) W: no module named lxml (delayed, conditional import by xlrd.xlsx) W: no module named ElementC14N (top-level import by xml.etree.ElementTree) W: no module named _emx_link (conditional import by os) W: no module named posix (conditional import by os) W: no module named rourl2path (conditional import by urllib) W: no module named SOCKS (top-level import by ftplib) W: no module named _xmlplus (top-level import by xml) W: no module named Crypt (delayed, conditional import by __main__) W: no module named AES (delayed, conditional import by __main__) W: delayed exec statement detected at line 0 - bdb (c:\python27\lib\bdb.pyc) W: delayed eval hack detected at line 0 - bdb (c:\python27\lib\bdb.pyc) W: delayed eval hack detected at line 0 - bdb (c:\python27\lib\bdb.pyc) W: delayed __import__ hack detected at line 0 - optparse (c:\python27\lib\optparse.pyc) W: delayed conditional __import__ hack detected at line 0 - doctest (c:\python27\lib\doctest.pyc) W: delayed exec statement detected at line 0 - doctest (c:\python27\lib\doctest.pyc) W: delayed conditional __import__ hack detected at line 0 - doctest (c:\python27\lib\doctest.pyc) W: __all__ is built strangely at line 0 - tokenize (c:\python27\lib\tokenize.pyc) W: __all__ is built strangely at line 0 - tokenize (c:\python27\lib\tokenize.pyc) W: delayed __import__ hack detected at line 0 - pickle (c:\python27\lib\pickle.pyc) W: delayed __import__ hack detected at line 0 - pickle (c:\python27\lib\pickle.pyc) W: delayed __import__ hack detected at line 0 - encodings (c:\python27\lib\encodings\__init__.pyc) W: __all__ is built strangely at line 0 - dummy_threading (c:\python27\lib\dummy_threading.pyc) W: __all__ is built strangely at line 0 - dis (c:\python27\lib\dis.pyc) W: __all__ is built strangely at line 0 - hashlib (c:\python27\lib\hashlib.pyc) W: delayed conditional eval hack detected at line 0 - warnings (c:\python27\lib\warnings.pyc) W: delayed conditional __import__ hack detected at line 0 - warnings (c:\python27\lib\warnings.pyc) W: delayed __import__ hack detected at line 0 - email (c:\python27\lib\email\__init__.pyc) W: __all__ is built strangely at line 0 - wx (c:\python27\lib\site-packages\wx-2.9.3-msw\wx\__init__.pyc) W: __all__ is built strangely at line 0 - wx (c:\python27\lib\site-packages\wx-2.9.3-msw\wx\__init__.pyc) W: delayed exec statement detected at line 0 - pdb (c:\python27\lib\pdb.pyc) W: delayed conditional eval hack detected at line 0 - pdb (c:\python27\lib\pdb.pyc) W: delayed eval hack detected at line 0 - pdb (c:\python27\lib\pdb.pyc) W: delayed conditional eval hack detected at line 0 - pdb (c:\python27\lib\pdb.pyc) W: delayed eval hack detected at line 0 - pdb (c:\python27\lib\pdb.pyc) W: delayed conditional exec statement detected at line 0 - iu (D:\SOFT\pyinstaller-2.0\pyinstaller-2.0\PyInstaller\loader\iu.pyc) W: delayed conditional exec statement detected at line 0 - iu (D:\SOFT\pyinstaller-2.0\pyinstaller-2.0\PyInstaller\loader\iu.pyc) W: __all__ is built strangely at line 0 - collections (c:\python27\lib\collections.pyc) W: delayed exec statement detected at line 0 - collections (c:\python27\lib\collections.pyc) W: delayed conditional __import__ hack detected at line 0 - unittest.main (c:\python27\lib\unittest\main.pyc) W: delayed conditional __import__ hack detected at line 0 - unittest.loader (c:\python27\lib\unittest\loader.pyc) W: delayed conditional __import__ hack detected at line 0 - unittest.loader (c:\python27\lib\unittest\loader.pyc) W: delayed __import__ hack detected at line 0 - unittest.loader (c:\python27\lib\unittest\loader.pyc) W: __all__ is built strangely at line 0 - __future__ (c:\python27\lib\__future__.pyc) W: delayed __import__ hack detected at line 0 - xml.sax (c:\python27\lib\xml\sax\__init__.pyc) W: delayed eval hack detected at line 0 - gettext (c:\python27\lib\gettext.pyc)
恨天低 2013-05-21
  • 打赏
  • 举报
回复
采用第三方库打包吧,cx_Freeze
angel_su 2013-05-21
  • 打赏
  • 举报
回复
不要双击执行,在控制台下执行,看看报啥错...

37,718

社区成员

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

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