Closed wangtieqiao closed 3 years ago
Hi. First of all. The directory for descriptor seems to be wrong. It should be ~/.jupyter_kotlin/libraries/
, where ~
is a user home.
In future releases, you should be able to use direct file notation like %use plotly@file[/home/user/plotly.json]
. It is described here: https://github.com/Kotlin/kotlin-jupyter#supported-libraries. It should be able to work even without file download just, by references master branch on github: %use plotly@url[https://raw.githubusercontent.com/mipt-npm/plotly.kt/master/notebooks/plotly.json]
. Does not work right now though, so you will have to find this library directory.
The build against Kotlin 1.4.0 and kotlinx-serialization 1.0.0-rc won't work right now (see #45 ). We will support 1.4.0 starting at next version (0.3.0 since it will break some binary compatibility). Currently the JS target is broken on 1.4 so I will need to wait untill 1.4.20 for it to be fixed. Right now builds against kotlin 1.3.72 and serialization 0.20.0 should work.
Your code does not work because I forgot to fix a mistake in the readme. We changed the package name (should be kscience.plotlykt
instead of scientifik
) just before the release and it seems that readme holds the old version. I will fix it right away. The package is available on bintray.
After https://github.com/Kotlin/kotlin-jupyter/pull/103. Descriptors should work without local files.
Thanks for looking into the issue @altavir
I changed build.gradle.kts based on you mentioned fix above and got that build worked.
// implementation("scientifik:plotlykt-core:0.2.0") // implementation("scientifik:plotlykt-server:0.2.0") implementation("kscience.plotlykt:plotlykt-core:0.2.0") implementation("kscience.plotlykt:plotlykt-server:0.2.0")
for my installation, the libraries dir is uner
(base) ~/anaconda3/lib/python3.8/site-packages/run_kotlin_kernel/libraries$ ls -l total 88 -rw-rw-r-- 2 tieqiao tieqiao 1079 Aug 5 12:01 dataframe.json -rw-rw-r-- 2 tieqiao tieqiao 1507 Aug 5 12:01 deeplearning4j-cuda.json -rw-rw-r-- 2 tieqiao tieqiao 1423 Aug 5 12:01 deeplearning4j.json -rw-rw-r-- 2 tieqiao tieqiao 61 Aug 5 12:01 default.json -rw-rw-r-- 2 tieqiao tieqiao 260 Aug 5 12:01 exposed.json -rw-rw-r-- 2 tieqiao tieqiao 414 Aug 5 12:01 fuel.json -rw-rw-r-- 2 tieqiao tieqiao 787 Aug 5 12:01 gral.json -rw-rw-r-- 2 tieqiao tieqiao 138 Aug 5 12:01 khttp.json -rw-rw-r-- 2 tieqiao tieqiao 183 Aug 5 12:01 klaxon.json -rw-rw-r-- 2 tieqiao tieqiao 350 Aug 5 12:01 kmath.json -rw-rw-r-- 2 tieqiao tieqiao 318 Aug 5 12:01 koma.json -rw-rw-r-- 2 tieqiao tieqiao 239 Aug 5 12:01 kotlin-statistics.json -rw-rw-r-- 2 tieqiao tieqiao 1311 Aug 5 12:01 krangl.json -rw-rw-r-- 2 tieqiao tieqiao 255 Aug 5 12:01 kravis.json -rw-rw-r-- 2 tieqiao tieqiao 1006 Aug 5 12:01 lets-plot-dataframe.json -rw-rw-r-- 2 tieqiao tieqiao 1375 Aug 5 12:01 lets-plot.json -rw-rw-r-- 2 tieqiao tieqiao 161 Aug 5 12:01 mysql.json -rw-rw-r-- 2 tieqiao tieqiao 422 Aug 5 12:01 numpy.json -rw-rw-r-- 1 tieqiao tieqiao 980 Sep 13 16:31 plotly.json -rw-rw-r-- 1 tieqiao tieqiao 1128 Sep 13 16:32 plotly-server.json -rw-rw-r-- 2 tieqiao tieqiao 399 Aug 5 12:01 smile.json -rw-rw-r-- 2 tieqiao tieqiao 2576 Aug 5 12:01 spark.json
and in the dir you mentioned, seems just a cache directory copied over from above dir
~/.jupyter_kotlin$ ls -l */*/* -rw-rw-r-- 1 tieqiao tieqiao 1010 Sep 13 16:32 cache/libraries/dataframe.json -rw-rw-r-- 1 tieqiao tieqiao 1374 Sep 13 16:32 cache/libraries/deeplearning4j-cuda.json -rw-rw-r-- 1 tieqiao tieqiao 1287 Sep 13 16:32 cache/libraries/deeplearning4j.json -rw-rw-r-- 1 tieqiao tieqiao 115 Sep 13 16:32 cache/libraries/default.json -rw-rw-r-- 1 tieqiao tieqiao 249 Sep 13 16:32 cache/libraries/exposed.json -rw-rw-r-- 1 tieqiao tieqiao 383 Sep 13 16:32 cache/libraries/fuel.json -rw-rw-r-- 1 tieqiao tieqiao 752 Sep 13 16:32 cache/libraries/gral.json -rw-rw-r-- 1 tieqiao tieqiao 147 Sep 13 16:32 cache/libraries/khttp.json -rw-rw-r-- 1 tieqiao tieqiao 179 Sep 13 16:32 cache/libraries/klaxon.json -rw-rw-r-- 1 tieqiao tieqiao 348 Sep 13 16:32 cache/libraries/kmath.json -rw-rw-r-- 1 tieqiao tieqiao 298 Sep 13 16:32 cache/libraries/koma.json -rw-rw-r-- 1 tieqiao tieqiao 255 Sep 13 16:32 cache/libraries/kotlin-statistics.json -rw-rw-r-- 1 tieqiao tieqiao 1280 Sep 13 16:32 cache/libraries/krangl.json -rw-rw-r-- 1 tieqiao tieqiao 253 Sep 13 16:32 cache/libraries/kravis.json -rw-rw-r-- 1 tieqiao tieqiao 952 Sep 13 16:32 cache/libraries/lets-plot-dataframe.json -rw-rw-r-- 1 tieqiao tieqiao 1249 Sep 13 16:32 cache/libraries/lets-plot.json -rw-rw-r-- 1 tieqiao tieqiao 167 Sep 13 16:32 cache/libraries/mysql.json -rw-rw-r-- 1 tieqiao tieqiao 403 Sep 13 16:32 cache/libraries/numpy.json -rw-rw-r-- 1 tieqiao tieqiao 385 Sep 13 16:32 cache/libraries/smile.json -rw-rw-r-- 1 tieqiao tieqiao 2506 Sep 13 16:32 cache/libraries/spark.json
Anyway, thanks again for the prompt response, I am in process switch from Python to Kotlin (tried switch to Julia a year ago but had to give up due to too many issues), I am very faithful to you guys. Can not wait to see great stuff come along ....
The documentation changed a bit since the last time I looked at it. Current documentation does not have this paragraph about directories. The one in user directory works fine. The one in conda is used only as a template.
We've tried Julia for some time and we have at least one ongoing projects running on it, but I think it is not the way we want to go. Kotlin scientific ecosystem is in its infancy. Jupyter kernel is highly unstable, but it already allows to do amazing things.
You are welcome to join us on kotlin slack #science channel.
Should work now out of the box.
I running into some issue with the setup:
Try to use in Jupyter, based on the documentation I red, just copy the
plotly.json
andplotyly-server.json
into my..../run_kotlin_kernel/libraries
folder then kotlin jupyter kernel should load it in. However I checked that it does not show up. (by type :help in my kotlin notebook, can not see those two libraries listed). I can not see any errorsThen I try to set up in my project and hope to get some clue what is going on, here are portion of my build.gradle.kts
when I try to build, got following complain