「PythonKit」を導入したい
SwiftからPythonスクリプトを呼ぶために「PythonKit」を導入したいのです。以下のサイトを参考にしました。
問題が発生しているのが手順4で、表示されるはずのApp Sandbox、Hardened Runtimeが表示されません。
https://qiita.com/john-rocky/items/906e54a976b4f0ae635a
表示されないので、その手順を飛ばした場合、pythonがunresolved identifierとエラーが出ます。
発生している問題・エラーメッセージ
やりたいこと(https://qiita.com/john-rocky/items/906e54a976b4f0ae635aからの引用)
![]
現在の状況
該当のソースコード
手順4を飛ばした状態でのソースコードです。(コメントアウトされているのがエラーメッセージです)
pythonがunresolved identifierと出ます。
Swift
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sys = Python.import("sys")//Use of unresolved identifier 'Python' sys.path.append("/Users/mlboy/PythonTest/") let example = Python.import("example") //Use of unresolved identifier 'Python' example.hello() } }
###試したこと
xcode内検索などをしましたが、見つかりませんでした。
まだ回答がついていません
会員登録して回答してみよう