How to use/install a Swift library in Collab

(Vova Manannikov) #21

Try this one?

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

#22

Oh this works thanks a lot @vova

0 Likes

(Korakot Chaovavanich) #23

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).

0 Likes