Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to install in Colab #53

Closed
rickwierenga opened this issue Dec 4, 2019 · 13 comments
Closed

Fails to install in Colab #53

rickwierenga opened this issue Dec 4, 2019 · 13 comments

Comments

@rickwierenga
Copy link

I was trying to install SwiftPlot in Colab, but got an error at installation. It's the first cell to be run.

Code:

%install-swiftpm-flags -Xcc -isystem/usr/include/freetype2 -Xswiftc -lfreetype
%install '.package(url: "https://github.com/KarthikRIyer/swiftplot", from: "1.0.0")' SwiftPlot

Error:

Installing packages:
	.package(url: "https://github.com/KarthikRIyer/swiftplot", from: "1.0.0")
		SwiftPlot
With SwiftPM flags: ['-Xcc', '-isystem/usr/include/freetype2', '-Xswiftc', '-lfreetype']
Working in: /tmp/tmpsmep6x4c/swift-install
Updating https://github.com/KarthikRIyer/swiftplot
error: the package swiftplot[https://github.com/KarthikRIyer/swiftplot] @ 1.0.0 contains incompatible dependencies:
    cfreetype[https://github.com/KarthikRIyer/CFreeType.git] @ master
Install Error: swift-build returned nonzero exit code 1.

Let me know if you need additional information.

@karwa
Copy link
Contributor

karwa commented Dec 4, 2019

There seems to be a problem with the separate freetype package (see #37), which the tagged version 1.0.0 is still using. Switch to master instead:

%install-swiftpm-flags -Xcc -isystem/usr/include/freetype2 -Xswiftc -lfreetype
%install '.package(url: "https://github.com/KarthikRIyer/swiftplot", .branch("master"))' SwiftPlot AGGRenderer

Also, you need to tell it to build the AGGRenderer now by adding that alongside "SwiftPlot".

@KarthikRIyer
Copy link
Owner

@rickwierenga you also need to include this in the 1st cell:
%install '.package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.28")' Cryptor

I dont know why I included it in the swift-jupyter docs but missed it here. Anyways, I've updated the docs.

@rickwierenga
Copy link
Author

So I installed it and everything is imported correctly. However, nothing is showing in the notebook. I inspected the base64 encoded image and it's almost completely filled with A (pastebin). I don't think this really represents an image... This is supposed a plot of just 15 points. Does anyone know if this is a common issue?

@KarthikRIyer
Copy link
Owner

@rickwierenga This has happened before with me, but I am not sure why. I'm trying to figure it out. Till then you could use the compiler in the terminal, or xcode to get started. SwiftPlot doesn't require the S4TF toolchain.

@KarthikRIyer
Copy link
Owner

@rickwierenga I don't know for sure but I don't think the problem is on SwiftPlot's side. A test has been added recently checking if the base64 encoding works. That doesn't seem to fail. I tried plotting using swift-jupyter. It works when I try plotting for the first time, but when I re-execute the cell with the plotting code, I get the same issue. I've asked Marc Rasi, who works on swift-jupyter, about this issue. You could try using swift-jupter or work with xcode or terminal for now.

@KarthikRIyer
Copy link
Owner

@rickwierenga it should now work in swift-jupyter. But it still doesn't work on colab.

@boronhub
Copy link
Contributor

swift-jupyter isn't working still

@boronhub
Copy link
Contributor

@rickwierenga have you tried using the linux port of swift?

@WilliamHYZhang
Copy link
Contributor

WilliamHYZhang commented Jan 1, 2020

SwiftPlot with Linux port of swift seems to be working fine. swift-jupyter is also giving me some difficulty. @boronhub @rickwierenga are you getting the same issue as #77?

@rickwierenga
Copy link
Author

#77 seems to be fixed. Colab works too, despite a lot of warnings generated by the Swift compiler. See this example.

Unfortunately, live view does not work in Colab but I doubt that's an error in SwiftPlot. It is possible to download the image and view it locally. I have not tested it on a Linux machine so I'm not sure if it works there.

@WilliamHYZhang
Copy link
Contributor

WilliamHYZhang commented Jan 3, 2020

👍 That's great everything is working now with the install and usage. I actually have an idea to get live view working on Colab btw, will update later. @rickwierenga Are you planning on working on the SwiftPlot task soon?

@rickwierenga
Copy link
Author

It would be great if live view were supported. Let me know if you need help implementing it.

@WilliamHYZhang I'm actually doing a Python TensorFlow task now, but I hope to make a contribution to SwiftPlot before the contest ends.

@WilliamHYZhang
Copy link
Contributor

Great, sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants