tensorflow / swift

Swift for TensorFlow
https://tensorflow.org/swift
Apache License 2.0
6.13k stars 608 forks source link

swift can't import python #433

Closed AbhimanyuAryan closed 4 years ago

AbhimanyuAryan commented 4 years ago

I have installed s4tf on windows.

Sample Code:

import TensorFlow
import Python

var x = Tensor<Float>([[1,2], [3,4]])
print(x + x) 

I'm trying to include python libraries but I get this error:

λ swiftc -sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows -emit-executable test.swift -o test.exe
test.swift:2:8: error: no such module 'Python'
import Python
       ^
ematejska commented 4 years ago

Please use import PythonKit. We recently moved to PythonKit from the Python module.