Kotlin/kotlin-numpy

TypeError: expected str, bytes or os.PathLike object, not NoneType

breandan opened this issue · 1 comments

I encountered an error running the KotlinNumpy.ipynb sample with Python 3.7.7 on Anaconda. Not sure if this is an issue with Kotlin Jupyter or Kotlin-NumPy. I'll paste it here in case it helps:

java.lang.Exception: "ERROR: Command errored out with exit status 1:
     command: /home/breandan/anaconda3/envs/jupyter/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6mvnxo8k/ktnumpy_48cc07a285f44b658c0646b09fcae090/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6mvnxo8k/ktnumpy_48cc07a285f44b658c0646b09fcae090/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nsimjoic
         cwd: /tmp/pip-install-6mvnxo8k/ktnumpy_48cc07a285f44b658c0646b09fcae090/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-6mvnxo8k/ktnumpy_48cc07a285f44b658c0646b09fcae090/setup.py", line 67, in <module>
        include_dirs=get_java_includes() + ['src/main/ktnumpy/jni/include', get_numpy_include()]
      File "/tmp/pip-install-6mvnxo8k/ktnumpy_48cc07a285f44b658c0646b09fcae090/buildScr/python/utils.py", line 76, in get_java_includes
        java_include = os.path.join(java_home, 'include')
      File "/home/breandan/anaconda3/envs/jupyter/lib/python3.9/posixpath.py", line 76, in join
        a = os.fspath(a)
    TypeError: expected str, bytes or os.PathLike object, not NoneType
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output." when executing the command: python -m pip install -i https://pypi.org/simple/ ktnumpy==0.1.4
org.jetbrains.numkt.LibraryLoader.execCommand(NativeLibUtils.kt:138)
org.jetbrains.numkt.LibraryLoader.loadLibraries(NativeLibUtils.kt:94)
org.jetbrains.numkt.Interpreter.initialize(Interpreter.kt:49)
org.jetbrains.numkt.Interpreter.access$initialize(Interpreter.kt:23)
org.jetbrains.numkt.Interpreter$Companion.getInterpreter(Interpreter.kt:30)
org.jetbrains.numkt.UtilsKt.callFunc(Utils.kt:59)
org.jetbrains.numkt.UtilsKt.callFunc$default(Utils.kt:57)
Line_1.<init>(Line_1.jupyter-kts:13)
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.evalWithConfigAndOtherScriptsResults(BasicJvmScriptEvaluator.kt:96)
kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke$suspendImpl(BasicJvmScriptEvaluator.kt:41)
kotlin.script.experimental.jvm.BasicJvmScriptEvaluator.invoke(BasicJvmScriptEvaluator.kt)
kotlin.script.experimental.jvm.BasicJvmReplEvaluator.eval(BasicJvmReplEvaluator.kt:51)
org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl$eval$resultWithDiagnostics$1.invokeSuspend(InternalEvaluatorImpl.kt:63)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:63)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$$inlined$with$lambda$1.invoke(CellExecutorImpl.kt:57)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$$inlined$with$lambda$1.invoke(CellExecutorImpl.kt:26)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withHost(repl.kt:506)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:56)
org.jetbrains.kotlinx.jupyter.repl.CellExecutor$DefaultImpls.execute$default(CellExecutor.kt:20)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$eval$1.invoke(repl.kt:352)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$eval$1.invoke(repl.kt:140)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withEvalContext(repl.kt:332)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.eval(repl.kt:347)
org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:279)
org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt)
org.jetbrains.kotlinx.jupyter.ProtocolKt.evalWithIO(protocol.kt:435)
org.jetbrains.kotlinx.jupyter.ProtocolKt.shellMessagesHandler(protocol.kt:278)
org.jetbrains.kotlinx.jupyter.IkotlinKt.kernelServer(ikotlin.kt:129)
org.jetbrains.kotlinx.jupyter.IkotlinKt.kernelServer$default(ikotlin.kt:97)
org.jetbrains.kotlinx.jupyter.IkotlinKt.main(ikotlin.kt:74)

Check if java_home is set in PATH