How to use PythonKit without disabling sandbox

I want to create a macOS application that runs Python script locally. As now I found that using 'PythonKit' library and disabling Sandbox allow me to do that, but disabling sandbox makes the app can't be published.

Any idea how I can solve this problem?

Thanks

I tried to use the portable-python tool to build a live python executable, so I can put this executable in the app sandbox folder.

You can have a try, but in my use case where I have to build an x86 python 3.7 for USDZ Tools, it always results in errors. Might because of their python build script.

I found in PythonKit docs it mentioned you have to put python framwork into sandbox folder to make it work, but I didn't find a way to build the framework.

So, same problem here. Any potential work-arounds?

How to use PythonKit without disabling sandbox
 
 
Q