2016-11-18 107 views
3

Pyinstaller版本3.2PyInstaller 「ValueError異常:值過多解壓」

OS:win10


我的python腳本的工作以及在Winpython Python解釋。

但是,當我使用Pyinstaller打包python腳本包括朱古力模塊, 我將面對的問題: 「You may load I/O plugins with the skimage.io.use_plugin

我按照上面的答案來解決我的規格文件(鉤文件?)。我已經越來越以下錯誤:(ValueError異常:值過多解壓)

Traceback (most recent call last): 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\runpy.py", line 162, in _run_module_as_main 
"__main__", fname, loader, pkg_name) 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\runpy.py", line 72, in _run_code 
exec code in run_globals 
File "D:\Python\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Scripts\pyinstaller.exe\__main__.py", line 9, in <module> 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\__main__.py", line 90, in run 
run_build(pyi_config, spec_file, **vars(args)) 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build 
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\building\build_main.py", line 788, in main 
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\building\build_main.py", line 734, in build 
exec(text, spec_namespace) 
File "<string>", line 16, in <module> 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\building\build_main.py", line 223, in __init__ 
for name, pth in format_binaries_and_datas(datas, workingdir=spec_dir): 
File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\PyInstaller\building\utils.py", line 440, in format_binaries_and_datas 
for src_root_path_or_glob, trg_root_dir in binaries_or_datas: 
ValueError: too many values to unpack 

這是我的規格文件:

# -*- mode: python -*- 
block_cipher = None 

a = Analysis(['Demo_GenderAge.py'], 
     pathex=['D:\\Work\\test_code\\PyInstaller_Test_caffe'], 
     binaries=None, 
     datas=["skimage.io._plugins"], 
     hiddenimports=['skimage.io._plugins'], 
     hookspath=[], 
     runtime_hooks=[], 
     excludes=[], 
     win_no_prefer_redirects=False, 
     win_private_assemblies=False, 
     cipher=block_cipher) 
pyz = PYZ(a.pure, a.zipped_data, 
     cipher=block_cipher) 
exe = EXE(pyz, 
     a.scripts, 
     exclude_binaries=True, 
     name='Demo_GenderAge', 
     debug=False, 
     strip=False, 
     upx=True, 
     console=True) 
coll = COLLECT(exe, 
      a.binaries, 
      a.zipfiles, 
      a.datas, 
      strip=False, 
      upx=True, 
      name='Demo_GenderAge') 

能有一個人請告訴我怎麼解決呢?

+0

@Michael Mauderer 請給我一些提示嗎? –

回答

5

datas數組需要元組,而不是字符串。從pyinstaller docs

The list of data files is a list of tuples. Each tuple has two values, both of which must be strings:

  • The first string specifies the file or files as they are in this system now.
  • The second specifies the name of the folder to contain the files at run-time.

我想將上述信息對您的代碼會導致此:

...  
datas=[("skimage.io._plugins", '.')], 
... 

我希望幫助!

相關問題