This is my first time posting a question here as most of my questions have already been answered by someone else! I am working on a GUI application in python and am attempt
I had the same problem. Was solved by reinstalling the pyinstaller with the developer's branch version, following the directions in: https://github.com/pyinstaller/pyinstaller/issues/2137
The steps are:
pip uninstall pyinstaller
.python setup.py install
To iterate further on the best hidden answer from elton fernando.
# -*- mode: python ; coding: utf-8 -*-
from kivy_deps import sdl2, glew
import pkg_resources.py2_warn # before you add it to hiddenimports, import it here.
import dependency_injector.errors
import six
block_cipher = None
a = Analysis(['...'],
pathex=['..'],
binaries=[],
datas=[],
hiddenimports=['pkg_resources.py2_warn', 'dependency_injector.errors', 'six'], # This is the line you need
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='...',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
Tree('./'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
upx_exclude=[],
name='...')
Whenever you encounter an import error, just import them at the top and add them as a string to hiddenimports in the array.