斯威夫特用Python叫Python

2024-09-29 23:18:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用Swift调用Python,所以我下载了一个PythonKit并构建它,但是得到了以下错误消息。如果我添加PythonKit依赖项,它将显示“Segmentation fault11”。有人知道怎么解决吗?或者其他任何方式可以在Swift中调用Python?在

https://github.com/pvieito/PythonKit


swift run

Compile Swift Module 'PythonKit' (4 sources) /PythonKit-master/PythonKit/Python.swift:82:2: error: unknown attribute 'dynamicCallable' @dynamicCallable ^

/PythonKit-master/PythonKit/Python.swift:82:2: error: unknown attribute 'dynamicCallable' @dynamicCallable ^

/PythonKit-master/PythonKit/Python.swift:128:26: warning: 'CustomPlaygroundQuickLookable' is deprecated: CustomPlaygroundQuickLookable will be removed in a future Swift version. For customizing how types are presented in playgrounds, use CustomPlaygroundDisplayConvertible instead. extension PythonObject : CustomPlaygroundQuickLookable {


If add

.package(url: "https://github.com/pvieito/PythonKit.git", .branch("master"))

It shows "Segmentation fault 11" when build.



Tags: inhttpsgithubmastercomattributeerrorunknown

热门问题