almond-sh / almond

A Scala kernel for Jupyter
https://almond.sh
BSD 3-Clause "New" or "Revised" License
1.59k stars 238 forks source link

jupyter-api not working; sbt.librarymanagement.ResolveException: Error downloading com.github.jupyter:jvm-repr:0.4.0 #588

Open FA5I opened 4 years ago

FA5I commented 4 years ago

Hi,

I want to work with the Jupyter API for a library I am building.

I add to my SBT file:

// almond jupyter api
libraryDependencies += "sh.almond" %% "jupyter-api" % "0.9.1"

Now, in my actual jvm source code, I add the following import:

import almond.interpreter.api.DisplayData

However I get the error:

sbt.librarymanagement.ResolveException: Error downloading com.github.jupyter:jvm-repr:0.4.0 So I think dependency inside the almond jupyter api is pointing to the wrong thing.

This can be overcome by adding jvm-repr as a seperate dependency for my project, but that screws up the dependency ordering and causes problems when I want to publish my package.

Could someone please assist?

cedricmjohn commented 4 years ago

Same problem here. Is there a workaround? I tried version 0.9.1 and 0.10.0 of the API with the same results. I am using Scala 13.2.

dzufferey commented 4 years ago

I ran into the same issue and managed to solve that by adding to my build.sbt:

resolvers += "jitpack" at "https://jitpack.io"

It seems that jvm-repr is also available on http://maven.imagej.net/content/repositories/public/ so add that instead should work as well.

cedricmjohn commented 4 years ago

@dzufferey I did the same, and it did get rid of the error message in my source code. However, when I want to use my library on almond I now need to do the following import in the first cell before anything else:

interp.repositories() ++= Seq(coursierapi.MavenRepository.of( "https://jitpack.io" ))

I am not sure why this is the case: it seems I have to explicitly import the jitpack.io dependency twice, once in the library I develop, and once in each notebook I want to use the library in...

Note that the Maven dependency did not work for me.

Am I doing something wrong, or is this a known issue that will be sorted in the future?

dzufferey commented 4 years ago

@cedricmjohn I did try on two different machines. One with almond 0.10.0 and the other with 0.9.1. The notebook ran fine on 0.10.0 but I had to add the resolver line you suggested to get it with 0.9.1. I got some classpath issue when upgrading to 0.10.0 (#595). My guess is that it may be related.