首页 > 解决方案 > 问:在 Jupyter notebook 中找不到 Kotlin 内核

问题描述

在安装 Kotlin 内核和使用pip3. fix-kernelspec-location正如 Kotlin Jupyter 内核回购https://github.com/Kotlin/kotlin-jupyter上的自述文件中所述,我也尝试了该脚本:

% python -m kotlin_kernel fix-kernelspec-location
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named kotlin_kernel
% python3 -m kotlin_kernel fix-kernelspec-location

要重现错误:

  1. 我使用jupyter lab.
  2. 我仍然只能使用 Python3 内核,如下图所示: 截图 2021-05-27 在 1 16 34 PM

任何帮助表示赞赏!我对设置 Python 环境还很陌生,并且以前对 Anaconda、虚拟环境等感到困惑,所以我现在选择让事情保持简单pip3

下面是我的安装过程的更多解释:在使用安装Jupyterpip3 install jupyter时,最后遇到以下错误:

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json'
Consider using the `--user` option or check the permissions.

谷歌搜索这个错误没有提供任何提示。然后我跑了pip3 install jupyterlab。在这一点上,尝试jupyter lab产生了这个错误:'ExtensionManager' object has no attribute '_extensions',我猜这与这个问题有关:https ://github.com/jupyterlab/jupyterlab/issues/10228 我在那个页面上尝试了修复,即jupyter server extension disable nbclassic。接下来,我卸载并重新安装了 Kotlin 内核,pip3 uninstall kotlin-jupyter-kernel然后使用pip3 install kotlin-jupyter-kernel. 下面是输出:

Collecting kotlin-jupyter-kernel
  Downloading kotlin_jupyter_kernel-0.10.0.40-py3-none-any.whl (70.5 MB)
     |████████████████████████████████| 70.5 MB 9.4 MB/s 
Installing collected packages: kotlin-jupyter-kernel
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/share/jupyter/kernels/kotlin'
Consider using the `--user` option or check the permissions.

我还在 Kotlin 内核存储库的一个问题中发布了这个问题:https ://github.com/Kotlin/kotlin-jupyter/issues/268 。谢谢!

标签: kotlinjupyter-notebook

解决方案


推荐阅读