Reputation: 23
I've been trying to package an application which requires gino-starlette
. I've tried including the requirement as a hidden import with command
pyinstaller --hidden-import gino_starlette --hidden-import gino.ext --noconfirm windows_runner.py --clean
but to no avail, the logs read that the gino_starlette was found, but running the executable gives the same error.
Log while running the executable:
Traceback (most recent call last):
File "gino\ext\__init__.py", line 72, in find_spec
ImportError: Cannot import gino.ext.starlette - is gino-starlette a valid extension and installed?
Piece of code which throws the specific error (this resides in gino.ext, which loads all extensions needed by gino):
def find_spec(self, fullname, path, target=None):
target = self._redirects.get(fullname)
if target:
mod = sys.modules.get(target)
if mod is None:
spec = find_spec(target)
spec.loader = _GinoExtensionCompatProxyLoader(fullname, spec.loader)
return spec
else:
return ModuleSpec(fullname, _GinoExtensionCompatNoopLoader(mod))
elif fullname.startswith(__name__):
raise ImportError(
"Cannot import {} - is gino-{} a valid extension and installed?".format(
fullname, fullname[len(__name__) + 1 :]
)
)
(I included the piece of code as https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html#listing-hidden-imports says that I should include it in hidden-import,which I did)
How should I proceed with debugging the problem?
Upvotes: 1
Views: 177