1

Pythonスクリプトをexeにパッケージ化しようとしています。Pythonスクリプトはそれ自体で問題なく機能しますが、py2exeまたはpyinstallerを使用することはできませんでした. 両方のプログラムが完了し、.exe が表示されますが、プログラムを正常に実行する代わりに、コマンド プロンプトが表示され、GUI の代わりに読むのが速すぎます。私は数週間グーグルで頭を悩ませてきましたが、困惑しています。Py2exe は、バイナリの依存関係に関する恐ろしい警告で終了します。

***binary dependencie ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.
Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

fftpack_lite.pyd - C:\Users\user\Desktop\Python\lib\site-packages\num
fftpack_lite.pyd
OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
USER32.dll - C:\Windows\system32\USER32.dll
IMM32.dll - C:\Windows\system32\IMM32.dll
SHELL32.dll - C:\Windows\system32\SHELL32.dll
ole32.dll - C:\Windows\system32\ole32.dll
RPCRT4.dll - C:\Windows\system32\RPCRT4.dll
COMDLG32.dll - C:\Windows\system32\COMDLG32.dll
ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
msvcrt.dll - C:\Windows\system32\msvcrt.dll
WS2_32.dll - C:\Windows\system32\WS2_32.dll
WINSPOOL.DRV - C:\Windows\system32\WINSPOOL.DRV
GDI32.dll - C:\Windows\system32\GDI32.dll
VERSION.dll - C:\Windows\system32\VERSION.dll
KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
mfc90.dll - C:\Users\user\Desktop\Python\lib\site-packages\Pythonwin\ll
COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
SETUPAPI.dll - C:\Windows\system32\SETUPAPI.dll
KERNELBASE.dll - C:\Windows\system32\KERNELBASE.dll
ntdll.dll - C:\Windows\system32\ntdll.dll*

これらのファイルを dist フォルダーにコピーすると、.exe が正しく実行されると想定しても安全ですか? パッケージを配布するつもりなら、合法的にそれを行うことはできますか? Pyinstaller が同様の最終結果をもたらしたのはなぜですか? Pyinstaller の出力:

C:\Users\user\Desktop\pyinstaller-2.0>python pyinstaller.py exe.py 
13 INFO: wrote C:\Users\user\Desktop\pyinstaller-2.0\exe\exe.spec 26 INFO: Testing for 
ability to set icons, version resources... 52 INFO: ... resource update available 55 
INFO: UPX is not available. 1003 WARNING: library python%s%s required via ctypes not 
found 1046 INFO: checking Analysis 1046 INFO: building Analysis because out00-
Analysis.toc non existent 1046 INFO: running Analysis out00-Analysis.toc 1046 INFO: 
Adding Microsoft.VC90.CRT to dependent assemblies of final executable
1091 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21 
022.8_none ... 1092 INFO: Found manifest C:\Windows\WinSxS\Manifests
\x86_microsoft.vc90.crt_1fc 8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest 
1092 INFO: Searching for file msvcr90.dll 1093 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll 1093 INFO: Searching for file 
msvcp90.dll 1093 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll 1093 INFO: Searching for file 
msvcm90.dll 1093 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll     1154 INFO: Analyzing C:\Users
\user\Desktop\pyinstaller-2.0\support\_pyi_bootstr ap.py 2126 WARNING: library 
python%s%s required via ctypes not found 2154 INFO: Analyzing C:\Users\user\Desktop
\pyinstaller-2.0\PyInstaller?\loader\a rchive.py 2253 INFO: Analyzing C:\Users
\user\Desktop\pyinstaller-2.0\PyInstaller?\loader\c archive.py 2351 INFO: Analyzing 
C:\Users\user\Desktop\pyinstaller-2.0\PyInstaller?\loader\i u.py 2368 INFO: Analyzing 
exe.py 2503 INFO: checking Tree 2504 INFO: building because out00-Tree.toc missing or 
bad 2504 INFO: building Tree out00-Tree.toc 2632 INFO: checking Tree 2632 INFO: 
building because out01-Tree.toc missing or bad 2632 INFO: building Tree out01-Tree.toc 
4046 WARNING: pythoncom is changing its name to pythoncom27 4060 WARNING: pywintypes 
is changing its name to pywintypes27 5055 INFO: Hidden import 'encodings' has been 
found otherwise 5055 INFO: Looking for run-time hooks 5056 INFO: Analyzing rthook 
C:\Users\user\Desktop\pyinstaller-2.0\support/rthoo ks/pyi_rth_Image.py 5065 INFO: 
Analyzing rthook C:\Users\user\Desktop\pyinstaller-2.0\support/rthoo 
ks/pyi_rth_PIL_Image.py 5072 INFO: Analyzing rthook C:\Users\user\Desktop\pyinstaller-
2.0\support/rthoo ks/pyi_rth_Tkinter.py 5155 INFO: Analyzing rthook C:\Users
\user\Desktop\pyinstaller-2.0\support/rthoo ks/pyi_rth_encodings.py 5237 INFO: 
Analyzing rthook C:\Users\user\Desktop\pyinstaller-2.0\support/rthoo 
ks/pyi_rth_versioneddll.py 5328 INFO: Analyzing rthook C:\Users\user\Desktop
\pyinstaller-2.0\support/rthoo ks/pyi_rth_win32comgenpy.py 5424 INFO: Analyzing rthook 
C:\Users\user\Desktop\pyinstaller-2.0\support/rthoo ks/pyi_rth_versioneddll.py 6231 
INFO: Adding Microsoft.VC90.MFC to dependent assemblies of final executable
6274 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21 
022.8_none ... 6274 INFO: Found manifest C:\Windows\WinSxS\Manifests
\x86_microsoft.vc90.mfc_1fc 8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86.manifest 
6276 INFO: Searching for file mfc90.dll 6276 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_ 9.0.21022.8_none_b81d038aaf540e86\mfc90.dll 
6276 INFO: Searching for file mfc90u.dll 6277 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_ 9.0.21022.8_none_b81d038aaf540e86\mfc90u.dll 
6277 INFO: Searching for file mfcm90.dll 6277 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_ 9.0.21022.8_none_b81d038aaf540e86\mfcm90.dll 
6277 INFO: Searching for file mfcm90u.dll 6279 INFO: Found file C:\Windows\WinSxS
\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_ 
9.0.21022.8_none_b81d038aaf540e86\mfcm90u.dll 6910 INFO: Adding 
Microsoft.Windows.Common-Controls to dependent assemblies of f inal executable 7081 
INFO: Warnings written to C:\Users\user\Desktop\pyinstaller-2.0\exe\build\ 
pyi.win32\exe\warnexe.txt 7092 INFO: checking PYZ 7092 INFO: rebuilding out00-PYZ.toc 
because out00-PYZ.pyz is missing 7092 INFO: building PYZ out00-PYZ.toc 9139 INFO: 
checking PKG 9139 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing 9141 
INFO: building PKG out00-PKG.pkg 9151 INFO: checking EXE 9151 INFO: rebuilding out00-
EXE.toc because exe.exe missing 9151 INFO: building EXE from out00-EXE.toc 9152 INFO: 
Appending archive to EXE C:\Users\user\Desktop\pyinstaller-2.0\exe\b uild\pyi.win32
\exe\exe.exe 9184 INFO: checking COLLECT 9184 INFO: building COLLECT out00-
COLLECT.toc* 

指示やアドバイスをありがとう!

4

2 に答える 2

1

pyinstaller の dev バージョンを試してください。

于 2013-04-27T00:54:19.197 に答える
0

簡単に言えば、cxFreeze は、scipy をパックしようとしない場合に機能します。

于 2013-03-20T02:31:20.013 に答える