0

我正在使用 PyInstaller 构建我的 Python/wxPython 项目。它让我很高兴成为一个 Mac 应用程序,但我在使用 Windows 时遇到了一些问题。

有两个问题。首先,构建包时出错。其次,生产.exe的产品运行时出现奇怪的错误。

构建时的错误

29 INFO: Testing for ability to set icons, version resources...
29 INFO: ... resource update available
39 INFO: UPX is not available.
59 INFO: Processing hook hook-os
170 INFO: Processing hook hook-time
170 INFO: Processing hook hook-cPickle
240 INFO: Processing hook hook-_sre
359 INFO: Processing hook hook-cStringIO
460 INFO: Processing hook hook-encodings
480 INFO: Processing hook hook-codecs
851 INFO: Extending PYTHONPATH with c:\Users\USERNAME\project
851 INFO: checking Analysis
851 INFO: building Analysis because out00-Analysis.toc non existent
851 INFO: running Analysis out00-Analysis.toc
851 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
940 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
940 INFO: Found manifest c:\Python27\Microsoft.VC90.CRT.manifest
950 INFO: Searching for file msvcr90.dll
950 INFO: Found file c:\Python27\msvcr90.dll
950 INFO: Searching for file msvcp90.dll
950 WARNING: No such file c:\Python27\msvcp90.dll
950 WARNING: Assembly incomplete
950 ERROR: Assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
1030 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
1030 INFO: Found manifest c:\Python27\Microsoft.VC90.CRT.manifest
1030 INFO: Searching for file msvcr90.dll
1030 INFO: Found file c:\Python27\msvcr90.dll
1030 INFO: Searching for file msvcp90.dll
1030 WARNING: No such file c:\Python27\msvcp90.dll
1030 WARNING: Assembly incomplete
1030 ERROR: Assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none not found
1141 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\_pyi_bootstrap.py
1151 INFO: Processing hook hook-os
1171 INFO: Processing hook hook-site
1180 INFO: Processing hook hook-encodings
1300 INFO: Processing hook hook-time
1300 INFO: Processing hook hook-cPickle
1371 INFO: Processing hook hook-_sre
1492 INFO: Processing hook hook-cStringIO
1601 INFO: Processing hook hook-codecs
2052 INFO: Processing hook hook-pydoc
2193 INFO: Processing hook hook-email
2253 INFO: Processing hook hook-httplib
2292 INFO: Processing hook hook-email.message
2342 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\pyi_importers.py
2392 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\pyi_archive.py
2443 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\pyi_carchive.py
2483 INFO: Analyzing C:\Python27\lib\site-packages\PyInstaller\loader\pyi_os_path.py
2483 INFO: Analyzing project/main.py
2773 INFO: Processing hook hook-anydbm
2834 INFO: Processing hook hook-xml
2904 INFO: Processing hook hook-xml.sax
2944 INFO: Processing hook hook-pyexpat
2953 INFO: Hidden import 'codecs' has been found otherwise
2953 INFO: Hidden import 'encodings' has been found otherwise
2963 INFO: Looking for run-time hooks
3334 INFO: Using Python library c:\Python27\python27.dll
3394 INFO: Warnings written to c:\Users\USERNAME\project\build\project\warnproject.txt
3394 INFO: checking PYZ
3394 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
3394 INFO: building PYZ (ZlibArchive) out00-PYZ.toc
4436 INFO: checking Tree
4436 INFO: building because out00-Tree.toc missing or bad
4436 INFO: building Tree out00-Tree.toc
4436 INFO: checking PKG
4436 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
4436 INFO: building PKG (CArchive) out00-PKG.pkg
5598 INFO: checking EXE
5598 INFO: rebuilding out00-EXE.toc because project.exe missing
5598 INFO: building EXE from out00-EXE.toc
5598 INFO: Appending archive to EXE c:\Users\USERNAME\PROJECT\dist\project.exe

运行时出错

Traceback (most recent call last):
  File "<string>", line 6, in <module>
ImportError: No module named pykka

为什么当我构建一个捆绑包时它发现Pykka很好,但是当我构建一个包时.exe它却失败得如此壮观?

4

1 回答 1

0

好吧,我的坏。我完全忘记pykka在 PyInstaller 可以找到它的环境中安装该模块,因为我在 VM 中运行。

pip install pykka为我修好了。

于 2013-10-23T12:23:53.793 回答