swift can't import python

Created on 28 Apr 2020  路  1Comment  路  Source: tensorflow/swift

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
       ^

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings