atom:已安装 hydrogen,但代码不是 运行(在 macOS 上)

atom: hydrogen installed, but the code is not running (on macOS)

我有以下设置:

运行 代码在 Terminal 以及 script 的原子中工作,但是当 运行 氢代码时没有任何反应:

HydrogenLanguage Mappings中写着:

{ "python": "magicpython", "python3": "magicpython" }

当 运行 jupyter kernelspec list 我得到:python3 /usr/local/etc/jupyter/kernels/python3。在此目录中有一个包含以下内容的 kernel.json 文件:

{
 "argv": [
  "/usr/local/Cellar/python/3.7.2_2/bin",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
"env": {
  "PYTHONPATH": "/usr/local/Cellar/ipython/7.3.0/libexec/lib/python3.7/site-packages:/usr/local/Cellar/ipython/7.3.0/libexec/vendor/lib/python3.7/site-packages"
}
,
 "display_name": "Python 3",
 "language": "python"
}

在目录/usr/local/Cellar/python/3.7.2_2/bin中有以下项目

2to3            pip3.7          python3.7-config
2to3-3.7        pydoc3          python3.7m
easy_install-3.7    pydoc3.7        python3.7m-config
idle3           python3         pyvenv
idle3.7         python3-config      pyvenv-3.7
pip3            python3.7       wheel3

kernel.json文件中的路径是否正确?

我也看了这个github page但是没能解决问题

我做错了什么?

您的 kernelspec argv 参数指向 ../python.3x/bin 而不是直接指向 python3 可执行文件。使用 ../python.3x/bin/python3 直接指向可执行文件更为典型,可能是问题所在。

你是怎么安装内核的?我建议您查看 this kernel installation guide 并可能重新安装您的内核,在您的情况下,python3 -m ipykernel install。我认为这会起作用,但是,手动编辑 kernel.json 文件将是解决此问题的另一种(不推荐)方法。