您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

我无法使用PythonKit在Xcode 11中导入Python模块

我无法使用PythonKit在Xcode 11中导入Python模块

一个SO答案,所以请原谅格式/等。我经历了一段时间,遇到了不同的错误,但总体上是相同的问题。我希望这对您有帮助-需要考虑的一些资源:

<-这是在iOS上运行后需要建模的东西,我的解决方案适用于Mac Catalyst (预装了Python的Mac)

2)Python Kit教程 -这个人一步一步地介绍了如何实现PythonKit

这对我有用:

1)在签名和功能中禁用应用沙箱:

在“应用程序沙箱”的右上角的“签名和功能”下,有一个“ X”,单击以删除该应用程序沙箱

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 AppSand@R_157_2419@ in Signing and Capabilities, and all Hardened Runtime Options (as in not disabling library validation).

python 2022/1/1 18:15:27 有500人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶