2012-07-30 75 views
0

我試圖捆綁一個相當廣泛的應用程序,它使用scikits-image/skimage,numpy,scipy,wx和reportlab。我在Windows 7 btw。使用pyinstaller捆綁應用程序時出錯(windows)

這似乎建立就好了:

1091 INFO: wrote C:\Users\IEUser\Desktop\pyinstaller\sasdm\sasdm.spec 
1200 INFO: Testing for ability to set icons, version resources... 
1923 INFO: ... resource update available 
1993 INFO: UPX is not available. 
12236 INFO: checking Analysis 
12246 INFO: building Analysis because out00-Analysis.toc non existent 
12246 INFO: running Analysis out00-Analysis.toc 
12256 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executabl 
e 
69579 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.2 
1022.8_none ... 
69589 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1f 
c8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest 
69640 INFO: Searching for file msvcr90.dll 
69650 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b 
_9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll 
69650 INFO: Searching for file msvcp90.dll 
69660 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b 
_9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll 
69660 INFO: Searching for file msvcm90.dll 
69660 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b 
_9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll 
70089 INFO: Analyzing C:\Users\IEUser\Desktop\pyinstaller\support\_pyi_bootstrap 
.py 
72563 INFO: Analyzing C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\arc 
hive.py 
72713 INFO: Analyzing C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\car 
chive.py 
72864 INFO: Analyzing C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu. 
py 
72904 INFO: Analyzing C:/Users/IEUser/Desktop/sasdm/sasdm.py 
90069 INFO: checking Tree 
90078 INFO: building because out00-Tree.toc missing or bad 
90078 INFO: building Tree out00-Tree.toc 
91530 INFO: checking Tree 
91530 INFO: building because out01-Tree.toc missing or bad 
91530 INFO: building Tree out01-Tree.toc 
98730 INFO: Hidden import 'encodings' has been found otherwise 
98742 INFO: Looking for run-time hooks 
98742 INFO: Analyzing rthook C:\Users\IEUser\Desktop\pyinstaller\support/rthooks 
/pyi_rth_Image.py 
98772 INFO: Analyzing rthook C:\Users\IEUser\Desktop\pyinstaller\support/rthooks 
/pyi_rth_PIL_Image.py 
98802 INFO: Analyzing rthook C:\Users\IEUser\Desktop\pyinstaller\support/rthooks 
/pyi_rth_Tkinter.py 
98911 INFO: Analyzing rthook C:\Users\IEUser\Desktop\pyinstaller\support/rthooks 
/pyi_rth_encodings.py 
100013 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of 
final executable 
123457 INFO: Warnings written to C:\Users\IEUser\Desktop\pyinstaller\sasdm\build 
\pyi.win32\sasdm\warnsasdm.txt 
123556 INFO: checking PYZ 
123556 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing 
123556 INFO: building PYZ out00-PYZ.toc 
155382 INFO: checking PKG 
155393 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing 
155393 INFO: building PKG out00-PKG.pkg 
199075 INFO: checking EXE 
199085 INFO: rebuilding out00-EXE.toc because sasdm.exe missing 
199085 INFO: building EXE from out00-EXE.toc 
199164 INFO: Appending archive to EXE C:\Users\IEUser\Desktop\pyinstaller\sasdm\ 
dist\sasdm.exe 

但是當我嘗試運行我有以下錯誤招呼應用:

_MEIPASS2 is NULL 
archivename is C:\Users\IEUser\Desktop\pyinstaller\sasdm\dist\sasdm.exe 
Extracting binaries 
Executing self as child with Setting up to run child 
Creating child process 
Waiting for child process to finish... 
_MEIPASS2 is C:/Users/IEUser/AppData/Local/Temp/_MEI39282/ 
archivename is C:\Users\IEUser\Desktop\pyinstaller\sasdm\dist\sasdm.exe 
Already in the child - running! 
manifestpath: C:/Users/IEUser/AppData/Local/Temp/_MEI39282/sasdm.exe.manifest 
Activation context created 
Activation context activated 
C:/Users/IEUser/AppData/Local/Temp/_MEI39282/python27.dll 
Manipulating evironment 
PYTHONPATH=C:/Users/IEUser/AppData/Local/Temp/_MEI39282;C:/Users/IEUser/Desktop/ 
pyinstaller/sasdm/dist 
PYTHONHOME=C:/Users/IEUser/AppData/Local/Temp/_MEI39282/ 
importing modules from CArchive 
extracted iu 
extracted struct 
extracted archive 
Installing import hooks 
out00-PYZ.pyz 
Running scripts 
Traceback (most recent call last): 
    File "<string>", line 10, in <module> 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 386, 
in importHook 
    mod = _self_doimport(nm, ctx, fqname) 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 480, 
in doimport 
    exec co in mod.__dict__ 
    File "C:\Users\IEUser\Desktop\pyinstaller\sasdm\build\pyi.win32\sasdm\out00-PY 
Z.pyz\cell_analysis", line 13, in <module> 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 431, 
in importHook 
    mod = self.doimport(nm, ctx, ctx + '.' + nm) 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 480, 
in doimport 
    exec co in mod.__dict__ 
    File "C:\Users\IEUser\Desktop\pyinstaller\sasdm\build\pyi.win32\sasdm\out00-PY 
Z.pyz\skimage.data", line 11, in <module> 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 386, 
in importHook 
    mod = _self_doimport(nm, ctx, fqname) 
    File "C:\Users\IEUser\Desktop\pyinstaller\PyInstaller\loader\iu.py", line 480, 
in doimport 
    exec co in mod.__dict__ 
    File "C:\Users\IEUser\Desktop\pyinstaller\sasdm\build\pyi.win32\sasdm\out00-PY 
Z.pyz\skimage.io", line 76, in <module> 
    File "C:\Users\IEUser\Desktop\pyinstaller\sasdm\build\pyi.win32\sasdm\out00-PY 
Z.pyz\skimage.io", line 56, in _update_doc 
ValueError: max() arg is an empty sequence 
RC: -1 from sasdm 
OK. 
Deactivating activation context 
Releasing activation context 
Done 
Back to parent... 
Freeing status for C:\Users\IEUser\Desktop\pyinstaller\sasdm\dist\sasdm.exe 

這使我相信,這裏有些不對勁與skimage/scikits-image,但我無法解決這個問題。有沒有人遇到類似的東西?

UPDATE

我也py2exe測試這一點,得到了下面的排序相同響應:

Traceback (most recent call last): 
    File "sasdm.py", line 10, in <module> 
    import cell_analysis 
    File "cell_analysis.pyc", line 13, in <module> 

    File "skimage\data\__init__.pyc", line 11, in <module> 
    File "skimage\io\__init__.pyc", line 76, in <module> 
    File "skimage\io\__init__.pyc", line 56, in _update_doc 
ValueError: max() arg is an empty sequence 

更新2

我現在已經縮小的問題了。在skimage/IO/_plugins/plugin.py,skimage將嘗試以下方式從文件中讀取它的插件:

pd = os.path.dirname(__file__) 
ini = glob(os.path.join(pd, '*.ini')) 

然而,文件計算結果爲不存在的(貌似隨機命名的)目錄。現在,skimage需要將其插件文件(.ini和.py)包含在軟件包中,然後在運行時需要在軟件包中查找它們。我猜第一位可以通過收集數據文件來完成,但第二部分?

+0

我們想在這裏解決這個問題:https://github.com/scikit -image/scikit-image/issues/1157你有任何反饋都會有幫助。 – 2014-12-13 12:39:09

回答

0

我有與cx_Freeze相同的問題。我的解決方法是將整個文件夾skimage從Python \ Lib \ site-packages複製到exe文件所在的文件夾中。

之後我得到一個新的錯誤「ImportError:沒有模塊命名信號」,我通過在build中添加scipy.signal來修復它。

順便說一句,以下錯誤:

ValueError: max() arg is an empty sequence 

通過這條線在我的代碼觸發:

from skimage import data