holgerbrandl / kravis

A {K}otlin g{ra}mmar for data {vis}ualization
BSD 2-Clause "Simplified" License
183 stars 12 forks source link

Problems rendering kotlin jupiter sample #26

Closed elect86 closed 3 years ago

elect86 commented 3 years ago

I tried to follow the tutorial

but I keep getting:

    at org.jetbrains.kotlinx.jupyter.config.LoggingKt.catchAll(logging.kt:41)
    at org.jetbrains.kotlinx.jupyter.config.LoggingKt.catchAll$default(logging.kt:40)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:404)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:383)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withEvalContext(repl.kt:347)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.evalEx(repl.kt:383)
    at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.eval(repl.kt:434)
    at org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:296)
    at org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:295)
    at org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$execThread$1.invoke(connection.kt:162)
    at org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$execThread$1.invoke(connection.kt:160)
    at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
Caused by: java.lang.RuntimeException: java.io.IOException: Cannot run program "R" (in directory "."): error=2, No such file or directory
    at kravis.render.RUtils.evalCmd(RenderEngine.kt:137)
    at kravis.render.RUtils.evalCmd$default(RenderEngine.kt:118)
    at kravis.render.RUtils.runRScript(RenderEngine.kt:103)
    at kravis.render.LocalR.render$kravis(LocalR.kt:28)
    at kravis.GGPlot.save(GGPlot2.kt:170)
    at kravis.device.JupyterDevice.show(JupyterDevice.kt:26)
    at kravis.device.JupyterDevice.show(JupyterDevice.kt:21)
    at kravis.GGPlot.show(GGPlot2.kt:175)
    at kravis.jupyter.Integration$onLoaded$1.invoke(Integration.kt:13)
    at kravis.jupyter.Integration$onLoaded$1.invoke(Integration.kt:13)
    at kravis.jupyter.Integration$onLoaded$$inlined$render$1.invoke(JupyterIntegration.kt:88)
    at kravis.jupyter.Integration$onLoaded$$inlined$render$1.invoke(JupyterIntegration.kt:34)
    at kravis.jupyter.Integration$onLoaded$$inlined$render$2.execute(JupyterIntegration.kt:95)
    at org.jetbrains.kotlinx.jupyter.codegen.RenderersProcessorImpl$renderResult$newField$1.invoke(RenderersProcessorImpl.kt:24)
    at org.jetbrains.kotlinx.jupyter.codegen.RenderersProcessorImpl$renderResult$newField$1.invoke(RenderersProcessorImpl.kt:23)
    at org.jetbrains.kotlinx.jupyter.exceptions.ReplLibraryExceptionKt.rethrowAsLibraryException(ReplLibraryException.kt:24)
    ... 14 more
Caused by: java.io.IOException: Cannot run program "R" (in directory "."): error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at kravis.render.RUtils.evalCmd(RenderEngine.kt:124)
    ... 29 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
    ... 31 more
holgerbrandl commented 3 years ago

That's an easy one. There are different rendering backends. See https://github.com/holgerbrandl/kravis#rendering

You are using the local r backend, but you don't have r installed.

elect86 commented 3 years ago

I'm using Datalore (IPython kernel in kotlin) and datascience isn't my background, how may I fix it?

holgerbrandl commented 3 years ago

Oh, I think since datalore is a hosted Sodas product there is no fix, unless the vendor does install r or enables support for a different kravis rendering backend

elect86 commented 3 years ago

Oh pity

Ok thanks for the info