本地计算机 (PC) 上 UI 右上角的下拉菜单:
Kernel->
Change kernel->
Python 2 (on a local PC)
Python 3 (on a local PC)
My new kernel (on a remote PC)
最佳答案
IPython notebook 通过预定义的端口与内核对话。要与远程内核通信,您只需将端口转发到远程计算机作为内核初始化的一部分,笔记本不关心内核在哪里,只要它可以与它通信。
您可以设置一个在内核规范文件 (https://ipython.org/ipython-doc/dev/development/kernels.html#kernel-specs) 中调用的包装脚本,或者使用可以帮助您设置和管理不同类型的远程内核的模块:(pip install remote_ikernel
;https://bitbucket.org/tdaff/remote_ikernel)。
如果您使用的是 remote_ikernel,并且对机器有 ssh 访问权限,则以下命令将在下拉列表中设置条目:
remote_ikernel manage --add \
--kernel_cmd="ipython kernel -f {connection_file}" \
--name="Remote Python" --interface=ssh \
--host=my_remote_machine
关于python - 如何在 IPython (Jupyter) Notebook 中的远程机器上添加内核?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29037211/