kotlin-jupyter: Cannot OptIn to an experimental annotation class
A minimal repro:
import kotlin.time.*
@ExperimentalTime
val res = runBlocking {
val mark = TimeSource.Monotonic.markNow()
delay(300)
mark.elapsedNow()
}
println(res)
Image for clarification:

About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 16 (9 by maintainers)
Does this compiles for you?
It seems that actual problem for you here is this issue
@frankgerhardt sorry for delay, I haven’t mentioned your message… For now it works like this.
Note that it should be the first executed cell in the notebook session.
Ok, the last problem left here (and the one that could be resolved) is passing free compiler args. It required some fixes in REPL, will get back to you once it will be merged and I’ll add this functionality.
The easiest way to resolve such issues is to set JUPYTER_PATH env. variable: https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs In your case it will be
%APPDATA%/Python/share/jupyterYou have this problem not because of Windows, but because of
In user mode paths are different, and Jupyter can’t find the installed kernel 😦
Maybe another fix is to run
pip installin cmd with administrative rights.I’m using
0.8.3basically pip installation didn’t work for me (notebook wasn’t appearing, testedbothon windows& linux), so I just cloned and ran install task:git clone https://github.com/Kotlin/kotlin-jupyter.git && cd kotlin-jupyter && ./gradlew installActually, compiles for me, but I’ll recheck and maybe add a possibility of passing compiler arguments (via magics)