Hi everyone,
I'm using pyinstaller to install my package and I see this warning
706 WARNING: Failed to collect submodules for 'X.Y.Z' because importing
'X.Y.Z' raised: TypeError: 'staticmethod' object is not callable
The file X.Y.Z contains a class like this
class MyClass:
# A bunch of other functions
@ abc.abstractmethod
async def _an_abstract_fun(self) -> List[Dict]:
raise NotImplementedError
@ staticmethod
def a_static_fun(x: str) -> str:
# Do something with x
return x
Even if I remove the staticmethod the WARNING do not disappear and most
importantly the binaries doesn't work because that module was not found.
I'm using the following spec file
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_submodules
from dateutil import zoneinfo
dateutil_binaries = zoneinfo.__path__[0] + '/' + zoneinfo.ZONEFILENAME
hiddenimports = [collect_submodules('X.Y.Z')]
block_cipher = None
a = Analysis(
['my-script.py'],
pathex=[],
binaries=[],
datas=[
('my/path/config', './my/path/config'),
(dateutil_binaries, 'dateutil/zoneinfo')
],
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
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,
a.binaries,
a.zipfiles,
a.datas,
[],
name='sq-poller-worker',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
Do you have any suggestion?
Luca
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyinstaller/d5800503-9e6a-4843-bc45-5b77aeaed0b7n%40googlegroups.com.