最近在研究将py文件转化为exe文件,先使用了py2exe,然后失败,
http://bbs.csdn.net/topics/391027909
然后转战pyinstaller
安装设置什么的略过,但是应该是没问题的,因为我先尝试了打包一个hello.py
用-D和-F两种形式,均没问题
然后就开始打包我所需要的文件,
我将它们都放在同一目录,方便打包
然后使用python pyinstaller.py -F lightcompute.py 命令
忘了说,我的原文件里面是import了另外3个文件外加matplotlib、numpy、pyqt等库
然后出现了一下问题
c:\Python27\pyinstaller>python pyinstaller.py -F lightcompute.py
36 INFO: wrote c:\Python27\pyinstaller\lightcompute\lightcompute.spec
59 INFO: Testing for ability to set icons, version resources...
62 INFO: ... resource update available
67 INFO: UPX is not available.
1146 INFO: checking Analysis
1146 INFO: building Analysis because out00-Analysis.toc non existent
1147 INFO: running Analysis out00-Analysis.toc
1148 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
1282 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.
21022.8_none ...
1282 WARNING: Assembly not found
1285 ERROR: Assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
not found
1411 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.
21022.8_none ...
1413 INFO: Found manifest C:\Windows\system32\Microsoft.VC90.CRT.manifest
1414 INFO: Searching for file msvcr90.dll
1416 INFO: Found file C:\Windows\system32\msvcr90.dll
1416 INFO: Searching for file msvcp90.dll
1419 INFO: Found file C:\Windows\system32\msvcp90.dll
1420 INFO: Searching for file msvcm90.dll
1421 WARNING: No such file C:\Windows\system32\msvcm90.dll
1424 WARNING: Assembly incomplete
1424 ERROR: Assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
not found
1503 INFO: Analyzing c:\Python27\pyinstaller\support\_pyi_bootstrap.py
2641 INFO: Analyzing c:\Python27\pyinstaller\PyInstaller\loader\archive.py
2775 INFO: Analyzing c:\Python27\pyinstaller\PyInstaller\loader\carchive.py
2933 INFO: Analyzing c:\Python27\pyinstaller\PyInstaller\loader\iu.py
2970 INFO: Analyzing lightcompute.py
5720 INFO: checking Tree
5924 INFO: checking Tree
7745 WARNING: pythoncom is changing its name to pythoncom27
7805 WARNING: pywintypes is changing its name to pywintypes27
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_webagg.py", li
ne 30, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.")
RuntimeError: The WebAgg backend requires Tornado.
Traceback (most recent call last):
File "pyinstaller.py", line 91, in <module>
main()
File "pyinstaller.py", line 86, in main
run_build(opts, spec_file)
File "pyinstaller.py", line 50, in run_build
PyInstaller.build.main(spec_file, **opts.__dict__)
File "c:\Python27\pyinstaller\PyInstaller\build.py", line 1625, in main
build(specfile, buildpath)
File "c:\Python27\pyinstaller\PyInstaller\build.py", line 1582, in build
execfile(spec)
File "c:\Python27\pyinstaller\lightcompute\lightcompute.spec", line 5, in <mod
ule>
hookspath=None)
File "c:\Python27\pyinstaller\PyInstaller\build.py", line 389, in __init__
self.__postinit__()
File "c:\Python27\pyinstaller\PyInstaller\build.py", line 315, in __postinit__
self.assemble()
File "c:\Python27\pyinstaller\PyInstaller\build.py", line 475, in assemble
importTracker.analyze_script(script)
File "c:\Python27\pyinstaller\PyInstaller\depend\imptracker.py", line 205, in
analyze_script
return self.analyze_r('__main__')
File "c:\Python27\pyinstaller\PyInstaller\depend\imptracker.py", line 98, in a
nalyze_r
newnms = self.analyze_one(name, nm, imptyp, level)
File "c:\Python27\pyinstaller\PyInstaller\depend\imptracker.py", line 159, in
analyze_one
mod = self.doimport(nm, ctx, fqname)
File "c:\Python27\pyinstaller\PyInstaller\depend\imptracker.py", line 256, in
doimport
hooks = __import__('PyInstaller.hooks', globals(), locals(), [hookmodnm])
TypeError: Item in ``from list'' not a string
啊!!!求助