First SO answer, so please forgive formatting / etc. I suffered through this for a while myself with different errors, but generally same issues. I hope this helps you -- a few resources to consider:
1) Pyto -- a fully embedded Python environment for iOS/Catalyst; with LXML and Python Library porting instructions <-- this is what you need to model after to run on iOS, my solution works for Mac Catalyst (Macs with Python preloaded)
2) Python Kit Tutorial -- this guy goes through, step by step, how to implement PythonKit
Here's what worked for me:
1) Disable App Sandbox in Signing and Capabilities:
In top right corner of App Sandbox, under Signing & Capabilities there is an "X", click that to remove App Sandbox
2) In "Hardened Runtime" under Signing and Capabilities: check "Disable Library Validation"
Image of checkbox for Disable Library Validation
Now, I haven't yet submitted an app to the App Store under these provisions, but at least my python files and libraries load / build / run!
UPDATE 05/15/2020:
For Mac Developer Distribution, you will have to sign all .so or .dylib's included with your app, along with the Python Interpreter and bin folder. I made a quick bash script to run through each one when done with dev.
function signThese() {
find . -name "*.$1" | while read line; do
codesign --force --verbose=4 --options=runtime --timestamp --sign "Developer ID Application: [INSERT YOUR CERT HERE]" $line
done
}
This will allow you to use AppSandbox in Signing and Capabilities, and all Hardened Runtime Options (as in not disabling library validation).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…