Error while building a project

29 views
Skip to first unread message

Joshua Whopper

unread,
May 10, 2021, 3:18:42 AM5/10/21
to PyInstaller
Hi all,

I am trying to obtain a linux exe from a python project. I've created a file .spec, modified it according my configuration (I suppose) but I get following error when run pyinstaller index.spec

File "/usr/local/lib/python3.5/dist-packages/pyinstaller-4.1-py3.5.egg/PyInstaller/building/build_main.py", line 720, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/usr/local/lib/python3.5/dist-packages/pyinstaller-4.1-py3.5.egg/PyInstaller/building/build_main.py", line 667, in build exec(code, spec_namespace) File "index.spec", line 18, in <module> noarchive=True)
File "/usr/local/lib/python3.5/dist-packages/pyinstaller-4.1-py3.5.egg/PyInstaller/building/build_main.py", line 253, in __init__ for name, pth in format_binaries_and_datas(datas, workingdir=spec_dir):
File "/usr/local/lib/python3.5/dist-packages/pyinstaller-4.1-py3.5.egg/PyInstaller/building/utils.py", line 484, in format_binaries_and_datas for src_root_path_or_glob, trg_root_dir in binaries_or_datas:
ValueError: too many values to unpack (expected 2)

and this is the file .spec. Its the first time I try build an exe so Im not sure the file .spec is correct

# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['index.py','calendar_draw.py','extract_draw.py','library.py','pezzoli_draw.py','ciminiere_draw.py','functions.py','makepdf_draw.py','projectr_draw.py','educat_draw.py','global_draw.py','makepdfhour_data.py','tirocinanti_draw.py','extract_data.py','index.py','perma_draw.py'],
pathex=['/opt/mambo'],
binaries=[],
datas=['fs.png','fsu.png','garnet.png','gg.png','logo_mambo.png','ohio.png','logo_auser.jpg'], hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz, a.scripts, [],
exclude_binaries=True,
name='index',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, upx_exclude=[], name='index')

bwoodsend

unread,
May 11, 2021, 11:09:09 AM5/11/21
to PyInstaller

datas=[‘fs.png’,’fsu.png’,’garnet.png’,’gg.png’,’logo_mambo.png’,’ohio.png’,’logo_auser.jpg’]

That’s not the correct format for data files. Each file should be a (source, destination) pair. You probably just want:

datas=[('fs.png', '.'), ('fsu.png', '.'), ('garnet.png', '.'), ('gg.png', '.'), ('logo_mambo.png', '.'), ('ohio.png', '.'), ('logo_auser.jpg', '.')]

which will dump each image in the root of your application.

Reply all
Reply to author
Forward
0 new messages