本文介绍了找不到语言json的内核-氢原子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现有些人抱怨python kernel,但这不是我的问题. 这是错误的打印屏幕,当我尝试运行一个ipynb文件,它会给我json kernel错误.

I have found some people complaining about the python kernel but that is not my issue. Here is a print screen of the error, where you can see that when I try to run an ipynb file it gives me an error with the json kernel.

该软件包已默认配置,并且我拥有Jupyter的Python2和Python3内核,如下所示.

The package is configure with default and I have the Python2 and Python3 kernels for Jupyter as you can see below.

:~ jupyter kernelspec list --json
{
"kernelspecs": {
"python2": {
  "spec": {
    "language": "python",
    "argv": [
      "/usr/local/opt/python/bin/python2.7",
      "-m",
      "ipykernel",
      "-f",
      "{connection_file}"
    ],
    "display_name": "Python 2",
    "env": {}
  },
  "resource_dir": "/usr/local/share/jupyter/kernels/python2"
},
"python3": {
  "spec": {
    "language": "python",
    "argv": [
      "/usr/local/opt/python3/bin/python3.5",
      "-m",
      "ipykernel",
      "-f",
      "{connection_file}"
    ],
    "display_name": "Python 3",
    "env": {}
  },
  "resource_dir": "/usr/local/share/jupyter/kernels/python3"
}
}
}

关于如何解决此问题的任何想法?

Any ideas on how to fix this?

推荐答案

对于仍在寻找此问题解决方案的任何人-尤其是那些将kernelspec json详细信息插入Hydrogen并得到"python无法被生成的人.在路上吗?"

For anyone still looking for a solution for this issue -- especially those who insert the kernelspec json details into Hydrogen and get "python can't be spawned. Is it in the path?"

对我来说,解决方案是将已安装的python envs(Anaconda)写入Jupyter的kernel.json文件中.该链接可很好地用于所有目的: https://ipython.readthedocs.io/zh/latest/install/kernel_install.html 具体来说,这行代码是我通过Anaconda提示符所需的全部代码:python -m ipykernel install --user

The solution for me was to write the installed python envs (Anaconda) to the kernel.json file for Jupyter. This link serves well for all purposes: https://ipython.readthedocs.io/en/latest/install/kernel_install.htmlSpecifically, this line of code was all I needed to push through the Anaconda prompt:python -m ipykernel install --user

对于要通过激活每个python env链接回Jupyter的许多内核,请执行此操作.

Do this for however many kernels you want to link back to Jupyter by activating each python env.

我认为对于其他语言,这将是一个非常相似的过程.这与链接不正确有关.

I assume that for other languages, it will be a very similar process. It has to do with the links not being correct.

这篇关于找不到语言json的内核-氢原子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 04:28