我正在尝试在 Jupyter 笔记本上使用 Scala 内核导入一些包。我的内核信息是:
Almond 0.6.0
Ammonite 1.6.7
Scala library version 2.11.12 -- Copyright 2002-2017, LAMP/EPFL
Java 1.8.0_232
当我尝试导入包时,我收到以下错误消息:
scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1390)
scala.tools.nsc.Global$Run.<init>(Global.scala:1242)
ammonite.interp.Compiler$$anon$2.<init>(Compiler.scala:272)
ammonite.interp.Compiler$.apply(Compiler.scala:158)
ammonite.interp.CompilerLifecycleManager.init(CompilerLifecycleManager.scala:82)
ammonite.interp.CompilerLifecycleManager.compileClass(CompilerLifecycleManager.scala:127)
ammonite.interp.Interpreter$$anonfun$evaluateLine$2.apply(Interpreter.scala:281)
ammonite.interp.Interpreter$$anonfun$evaluateLine$2.apply(Interpreter.scala:280)
ammonite.util.Catching.flatMap(Res.scala:115)
ammonite.interp.Interpreter.evaluateLine(Interpreter.scala:280)
ammonite.interp.Interpreter$$anonfun$processLine$2$$anonfun$apply$9$$anonfun$apply$11.apply(Interpreter.scala:263)
ammonite.interp.Interpreter$$anonfun$processLine$2$$anonfun$apply$9$$anonfun$apply$11.apply(Interpreter.scala:251)
ammonite.util.Res$Success.flatMap(Res.scala:62)
ammonite.interp.Interpreter$$anonfun$processLine$2$$anonfun$apply$9.apply(Interpreter.scala:251)
ammonite.interp.Interpreter$$anonfun$processLine$2$$anonfun$apply$9.apply(Interpreter.scala:244)
ammonite.util.Res$Success.flatMap(Res.scala:62)
ammonite.interp.Interpreter$$anonfun$processLine$2.apply(Interpreter.scala:244)
ammonite.interp.Interpreter$$anonfun$processLine$2.apply(Interpreter.scala:243)
ammonite.util.Catching.flatMap(Res.scala:115)
ammonite.interp.Interpreter.processLine(Interpreter.scala:243)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Execute.scala:227)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Execute.scala:223)
almond.internals.CaptureImpl$$anonfun$apply$1$$anonfun$apply$2.apply(CaptureImpl.scala:53)
scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
scala.Console$.withErr(Console.scala:80)
almond.internals.CaptureImpl$$anonfun$apply$1.apply(CaptureImpl.scala:45)
scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
scala.Console$.withOut(Console.scala:53)
almond.internals.CaptureImpl.apply(CaptureImpl.scala:44)
almond.Execute.almond$Execute$$capturingOutput(Execute.scala:165)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Execute.scala:223)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Execute.scala:223)
almond.Execute$$anonfun$almond$Execute$$withClientStdin$1.apply(Execute.scala:145)
scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
scala.Console$.withIn(Console.scala:124)
almond.Execute.almond$Execute$$withClientStdin(Execute.scala:141)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14.apply(Execute.scala:222)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13$$anonfun$apply$14.apply(Execute.scala:222)
almond.Execute.almond$Execute$$withInputManager(Execute.scala:133)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13.apply(Execute.scala:221)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12$$anonfun$apply$13.apply(Execute.scala:221)
ammonite.repl.Signaller.apply(Signaller.scala:28)
almond.Execute.almond$Execute$$interruptible(Execute.scala:181)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12.apply(Execute.scala:220)
almond.Execute$$anonfun$ammResult$1$$anonfun$apply$12.apply(Execute.scala:212)
ammonite.util.Res$Success.flatMap(Res.scala:62)
almond.Execute$$anonfun$ammResult$1.apply(Execute.scala:212)
almond.Execute$$anonfun$ammResult$1.apply(Execute.scala:212)
almond.Execute.withOutputHandler(Execute.scala:156)
almond.Execute.ammResult(Execute.scala:210)
almond.Execute.apply(Execute.scala:309)
almond.ScalaInterpreter.execute(ScalaInterpreter.scala:116)
almond.interpreter.InterpreterToIOInterpreter$$anonfun$execute$1$$anonfun$apply$3.apply(InterpreterToIOInterpreter.scala:69)
almond.interpreter.InterpreterToIOInterpreter$$anonfun$execute$1$$anonfun$apply$3.apply(InterpreterToIOInterpreter.scala:66)
cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:87)
cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:355)
cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:376)
cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:316)
cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
我已经寻求帮助,但大多数人建议将 Java 更改为 Java 8,我想我已经开始使用了,所以我不确定我还能做什么。任何帮助将不胜感激!:)
编辑:我卸载了 Scala 内核并再次安装,这次导入工作正常。