我想通过在Windows Vista上使用PyInstaller编译一个很简单的wxPython脚本转换成可执行文件。

在Python脚本只不过是一个Hello World在wxPython中。我试图让启动和运行一个Windows可执行文件之前,我添加任何的程序需要有特点。但我已经卡住了。

\ Program Files文件\微软的Visual Studio 9.0 \ VC \ REDIST:

我已经通过一些循环的问候MSVCR90.DLL,MSVCP90.DLL和MSVCPM90.DLL,我结束了从我的Visual Studio安装(C复制跃升\ 86 \ Microsoft.VC90.CRT)。

作为根据对PyInstaller指示,我运行:

Command:
Configure.py

Output:
I: computing EXE_dependencies
I: Finding TCL/TK...
I: could not find TCL/TK
I: testing for Zlib...
I: ... Zlib available
I: Testing for ability to set icons, version resources...
I: ... resource update available
I: Testing for Unicode support...
I: ... Unicode available
I: testing for UPX...
I: ...UPX available
I: computing PYZ dependencies...

到目前为止,一切都很好。我继续。

Command:
Makespec.py -F guitest.py

Output:
wrote C:\Code\PromoUSB\guitest.spec
now run Build.py to build the executable

然后是最后的命令。

Command:
Build.py guitest.spec

Output:
checking Analysis
building Analysis because out0.toc non existent
running Analysis out0.toc
Analyzing: C:\Python26\pyinstaller-1.3\support\_mountzlib.py
Analyzing: C:\Python26\pyinstaller-1.3\support\useUnicode.py
Analyzing: guitest.py
Warnings written to C:\Code\PromoUSB\warnguitest.txt
checking PYZ
rebuilding out1.toc because out1.pyz is missing
building PYZ out1.toc
checking PKG
rebuilding out3.toc because out3.pkg is missing
building PKG out3.pkg
checking ELFEXE
rebuilding out2.toc because guitest.exe missing
building ELFEXE out2.toc

我得到的产生“guitest.exe”文件,但在执行时,它“只是崩溃” ......并没有调试信息。这只是那些标准的Windows Vista崩溃的一个。

脚本本身,guitest.py运行只是通过本身细。它只是崩溃作为一个可执行文件,我完全失去了。我甚至不知道要寻找什么,因为什么我已经试过返回任何相关的结果。

另一个文件被作为编译过程的结果,称为“warnguitest.txt”中产生。下面是其内容。


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 readline (delayed import by pdb)
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 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:\Python26\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:\Python26\pyinstaller-1.3\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (C:\Python26\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:\Python26\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:\Python26\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)

我不知道究竟发生了什么做出的任何。再次,我的搜索已经徒劳的。

有帮助吗?

解决方案 2

我发现解决PyInstaller邮件列表上这个问题,并且它非常简单,只无证。

PyInstaller尚不支持的Python 2.6。解决的办法是得到一个网页,其中现在可以在编译过程中被发现,我是想一个补丁,如果试图使用Python 2.6编译。

谢谢大家虽然!

编辑:使用在 http://svn.pyinstaller.org/branches/被托管的网页py26win 但它不再存在。

其他提示

在我发现Py2exe更稳定和更容易使用的窗口,你试过了。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top