Swift call Python with PythonKit

823 Views Asked by At

I want to call Python in Swift so I download a PythonKit and build it, but got the following error message. If I add the PythonKit dependency, it shows "Segmentation fault 11". Does anyone know how to resolve it? or any other way can call Python in Swift?

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.


0

There are 0 best solutions below