jupyter:没有可用的内核
jupyter: no kernel available
有人可以告诉我为什么我 没有 可以选择 python3 作为内核吗?
# python3 -m ipykernel install --user
Installed kernelspec python3 in /root/.local/share/jupyter/kernels/python3
# python3 -m pip install ipykernel
Requirement already satisfied: ipykernel in /usr/lib/python3.4/site-packages
Requirement already satisfied: tornado>=4.0 in /usr/lib64/python3.4/site-packages (from ipykernel)
Requirement already satisfied: ipython>=4.0.0 in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: jupyter-client in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: traitlets>=4.1.0 in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: backports_abc>=0.4 in /usr/lib/python3.4/site-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pickleshare in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: decorator in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pygments in /usr/lib64/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: setuptools>=18.5 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: simplegeneric>0.8 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.3 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: jupyter-core in /usr/lib/python3.4/site-packages (from jupyter-client->ipykernel)
Requirement already satisfied: pyzmq>=13 in /usr/lib64/python3.4/site-packages (from jupyter-client->ipykernel)
Requirement already satisfied: ipython-genutils in /usr/lib/python3.4/site-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: six in /usr/lib/python3.4/site-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: ptyprocess>=0.5 in /usr/lib/python3.4/site-packages (from pexpect; sys_platform != "win32"->ipython>=4.0.0->ipykernel)
Requirement already satisfied: wcwidth in /usr/lib/python3.4/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython>=4.0.0->ipykernel)
从命令行我确实可以看到 python3 内核已安装
# jupyter kernelspec list
[ListKernelSpecs] WARNING | Native kernel (python2) is not available
[ListKernelSpecs] WARNING | Native kernel (python2) is not available
Available kernels:
python3 /root/.local/share/jupyter/kernels/python3
但是jupyter并不能理解它:
有人可以建议如何解决这个问题吗?
尝试:
python3 -m IPython kernelspec install-self
或
python3 -m jupyter kernelspec install-self
重新安装内核规范,
我指的是这个 issue
python3 -m jupyter kernelspec install-self
转到 Appdata/Roaming/Jupyter 中的 jupyter 文件夹
然后在文件夹里面,你会发现里面有一个kernels文件夹,里面会有很多内核,比如python3 etc
路径应该是这样的,
C:\Users\Jayasurya\AppData\Roaming\jupyter\kernels\python3
在此找到一个 kernel.json 文件
并确保您的 Python 可执行文件在文件
中
{
"argv": [
"c:\python\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
路径应该在 args 列表中,在我上面的代码中它在第 3 行 "c:\python\python.exe"
确保可执行路径是正确的
jupyter kernelspec install-self
自 4.0 起已弃用。
现在你必须使用
ipython kernel install
为了解决这个问题,我安装了 ipython 内核并且一切正常。
pip install ipython
有人可以告诉我为什么我 没有 可以选择 python3 作为内核吗?
# python3 -m ipykernel install --user
Installed kernelspec python3 in /root/.local/share/jupyter/kernels/python3
# python3 -m pip install ipykernel
Requirement already satisfied: ipykernel in /usr/lib/python3.4/site-packages
Requirement already satisfied: tornado>=4.0 in /usr/lib64/python3.4/site-packages (from ipykernel)
Requirement already satisfied: ipython>=4.0.0 in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: jupyter-client in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: traitlets>=4.1.0 in /usr/lib/python3.4/site-packages (from ipykernel)
Requirement already satisfied: backports_abc>=0.4 in /usr/lib/python3.4/site-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pickleshare in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: decorator in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pygments in /usr/lib64/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: setuptools>=18.5 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: simplegeneric>0.8 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.3 in /usr/lib/python3.4/site-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: jupyter-core in /usr/lib/python3.4/site-packages (from jupyter-client->ipykernel)
Requirement already satisfied: pyzmq>=13 in /usr/lib64/python3.4/site-packages (from jupyter-client->ipykernel)
Requirement already satisfied: ipython-genutils in /usr/lib/python3.4/site-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: six in /usr/lib/python3.4/site-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: ptyprocess>=0.5 in /usr/lib/python3.4/site-packages (from pexpect; sys_platform != "win32"->ipython>=4.0.0->ipykernel)
Requirement already satisfied: wcwidth in /usr/lib/python3.4/site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython>=4.0.0->ipykernel)
从命令行我确实可以看到 python3 内核已安装
# jupyter kernelspec list
[ListKernelSpecs] WARNING | Native kernel (python2) is not available
[ListKernelSpecs] WARNING | Native kernel (python2) is not available
Available kernels:
python3 /root/.local/share/jupyter/kernels/python3
但是jupyter并不能理解它:
尝试:
python3 -m IPython kernelspec install-self
或
python3 -m jupyter kernelspec install-self
重新安装内核规范, 我指的是这个 issue
python3 -m jupyter kernelspec install-self
转到 Appdata/Roaming/Jupyter 中的 jupyter 文件夹 然后在文件夹里面,你会发现里面有一个kernels文件夹,里面会有很多内核,比如python3 etc
路径应该是这样的,
C:\Users\Jayasurya\AppData\Roaming\jupyter\kernels\python3
在此找到一个 kernel.json 文件 并确保您的 Python 可执行文件在文件
中{
"argv": [
"c:\python\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
路径应该在 args 列表中,在我上面的代码中它在第 3 行 "c:\python\python.exe"
确保可执行路径是正确的
jupyter kernelspec install-self
自 4.0 起已弃用。
现在你必须使用
ipython kernel install
为了解决这个问题,我安装了 ipython 内核并且一切正常。
pip install ipython