pythonpython-3.xcx-freeze

How to make cx_Freeze compile submodules into shared object (.so) files?


Background

Problem

When I run python setup.py build (the command that has cx_Freeze "compile" our app), it seems only the one file I designate as the "main" file gets converted to an .so file, while the rest of our source code is converted to .pyc. We want all of our code to be .so files.

What I've tried


Solution

  • It isn't possible.

    I emailed the creator of cx_Freeze (Anthony Tuininga) and this was his response:

    cx_Freeze doesn't have that capability. It puts all of its compiled Python code (.pyc files) into a zip file. Technically, there is a way to do so, but cx_Freeze doesn't do so. Since it involves a C compiler its more complex and prone to error.