datafolklabs / cement

Application Framework for Python
http://builtoncement.com
BSD 3-Clause "New" or "Revised" License
1.24k stars 119 forks source link

Document Single Binary / Pyinstaller Howto #586

Open derks opened 4 years ago

tomjn commented 1 year ago

I've been trying to get this going without much luck, part of the stumbling blocks is:

There's no obvious entry point to pass to pyInstaller as the argument (which made figuring out what to do as a newcomer quite difficult too). Running which myappname and then using the result from virtualenv produces an executable output but it leads to a broken application with a stack trace similar to this:

❯ ./myapp
Traceback (most recent call last):
  File "importlib/metadata/__init__.py", line 563, in from_name
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "myapp", line 33, in <module>
  File "myapp", line 22, in importlib_load_entry_point
  File "importlib/metadata/__init__.py", line 981, in distribution
  File "importlib/metadata/__init__.py", line 565, in from_name
importlib.metadata.PackageNotFoundError: No package metadata was found for myapp
[37712] Failed to execute script 'myapp' due to unhandled exception!