Skip to content
Discussion options

You must be logged in to vote

Hi @golgitab, GPT-5 says:


Yep—this is a classic PyInstaller packaging hiccup, not a NiceGUI issue.

Why it happens

tortoise-orm (PyPI distribution name) provides package metadata that importlib.metadata reads at runtime. In a one-file PyInstaller build, that metadata isn’t bundled by default, so importlib.metadata.distribution("tortoise-orm") fails with:

importlib.metadata.PackageNotFoundError: No package metadata was found for tortoise-orm

Two solid fixes

1) Do it all from the command line (quickest)

Use PyInstaller’s collection flags to include the metadata, data files, and any dynamically imported submodules:

pyinstaller \
  --onefile \
  --name myapp \
  --copy-metadata tortoise-orm …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@golgitab
Comment options

Answer selected by golgitab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants