无法在jupyterhub中运行多个内核(Python版本)

时间:2016-01-19 16:32:31

标签: python-2.7 ipython python-3.4 jupyter jupyterhub

您好我正在使用jupyterhub运行笔记本服务器,但我无法访问不同的内核(python版本)。

我正确地设置了各种设施,当我输入

jupyter kernelspec list

我得到以下输出

Available kernels:              
bash       /home/username/.local/share/jupyter/kernels/bash  
python2    /usr/local/share/jupyter/kernels/python2                  
python3    /usr/local/share/jupyter/kernels/python3

但是当jupyterhub启动时它只发现Python3内核可用吗?

如何让它检测所有可用的python版本?

cat /usr/local/share/jupyter/kernels/python2/kernel.json  

{                                                   
"display_name": "Python 2",
"language": "python",
"argv": [
"/opt/anaconda3/envs/py27/bin/python2.7",
"-m",
"ipykernel",
"-f",
"{connection_file}"                                                        
]       
}

cat /usr/local/share/jupyter/kernels/python3/kernel.json  

{ 
"language": "python",                                                 
"display_name": "Python 3",
"argv": [
"/opt/anaconda3/bin/python3",
"-m",
"ipykernel",
"-f",
"{connection_file}"                                                        
] 
}

2 个答案:

答案 0 :(得分:2)

请检查/usr/local/share/jupyter/kernels/python2/kernel.json文件上的权限。如果它对每个人都不可读,那么你在Jupyter中看不到它。

它应该有644个权限:

# ls -l
-rw-r--r-- 1 root root  158 Apr 15 12:47 kernel.json

答案 1 :(得分:-1)

您是否为python2.7安装了ipykernel?

pip2.7 install ipykernel
python2.7 -m ipykernel install --user