我在学PyInstaller。我创建了两个简单的文件,测试.py公司名称:
import os
以及测试规范公司名称:
^{pr2}$然后我跑了:
Build.py Test.spec
它运行时没有任何错误消息,并生成了一个包含多个文件的目录dist,包括测试.exe. 当我跑的时候测试.exe,失败,输出:
Found embedded PKG: C:\Documents and Settings\Rade\My Documents\Development\Test\Test.exe
Extracting binaries
manifestpath: C:\Documents and Settings\Rade\My Documents\Development\Test\Test.
exe.manifest
Error activating the context
python27.dll
Manipulating evironment
PYTHONPATH=C:/Documents and Settings/Rade/My Documents/Development/Test
importing modules from CArchive
extracted iu
extracted struct
extracted archive
Installing import hooks
outPYZ1.pyz
Running scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named os
RC: -1 from Test
OK.
我真的犯了些愚蠢的错误?在
对于这样的简单文件,您应该使用
Makespec.py
来创建规范,而不是手动编写。对于大型项目,可以使用制造商规范.py的输出作为模板并进行编辑。在http://www.pyinstaller.org/export/latest/tags/1.4/doc/Manual.html#create-a-spec-file-for-your-project
相关问题 更多 >
编程相关推荐