Issues with a frozen Python application

Flavio Calva f.calva at gmail.com
Tue Aug 10 06:24:50 UTC 2021


Hi, I am trying to deploy an application using Flatpak. It is a Python
application, and I freeze it using a tool. So, the final "result" is
simple: an executable, some .so files and some assets (e.g. image
files).

Everything works when I execute it without Flatpak (launching the
executable in the built directory).  Then, I built a Flatpak repo, and
I installed it.

When I launch it using 'flatpak run', I get the following error:

Traceback (most recent call last):
  File "__main__", line 16, in <module>
  File "importlib._bootstrap", line 991, in _find_and_load
  File "importlib._bootstrap", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'math'

So, it looks like it can't find math.so. I have put it in /app/bin
(next to the executable) or /app/lib, but I get the same error.

A curious aspect is that it only happens with math.so: if I don't put
the other dependencies in /app/bin then I get errors for these, but I
can't solve this error for math.so.

What could I do? If I have an application with an executable and some
.so files, how should I arrange them?

Is it expected to work if I put them in /app/bin, like I do in the
"standalone" setting?

Thank you very much!


More information about the Flatpak mailing list