How to use/install a Swift library in Collab

Try this one?

%install '.package(url: "https://github.com/JustHTTP/Just", from: "0.7.1")' Just
1 Like

Oh this works thanks a lot @vova

I still got an error when installing Path

%install '.package(url: "https://github.com/mxcl/Path.swift.git", from: "0.13.0")' Path
import Path

It goes fine. But when I just want to use it.

Path.home

It gives this error:

expression produced error: error: /tmp/expr42-d260e3..swift:1:70: error: 'Path' is not a member type of 'Path'
Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer<Path.Path>(bitPattern: 0x7f3f4ae2a2d0)!.pointee)
                                                                ~~~~ ^

Here’s my colab notebook.
Did I make a mistake somewhere?

Update:
It installs successfully. My mistake is to use Path.home (print automatically) instead of print(Path.home).