英文:
How do you start a jupyter kernel with custom ports?
问题
我正在尝试像这样启动一个Jupyter内核:
jupyter-kernel \
--ip=0.0.0.0 \
--KernelManager.control_port=56406 \
--KernelManager.hb_port=56407 \
--KernelManager.iopub_port=56408 \
--KernelManager.shell_port=56409 \
--KernelManager.stdin_port=56410
它启动了,并且我看到以下输出:
[KernelApp] Starting kernel 'python3'
[KernelApp] Connection file: /Users/jkitchin/Library/Jupyter/runtime/kernel-892382b5-8115-44ba-95cd-d8172ba848ac.json
然而,内核JSON文件包含了以下内容:
cat /Users/jkitchin/Library/Jupyter/runtime/kernel-892382b5-8115-44ba-95cd-d8172ba848ac.json
{
"shell_port": 55505,
"iopub_port": 55506,
"stdin_port": 55507,
"control_port": 55509,
"hb_port": 55508,
"ip": "0.0.0.0",
"key": "0a163fda-2b4963c994abc4277bdf58fa",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
这些端口与我指定的端口不匹配。我是否漏掉了什么以使其生效?
英文:
I am trying to start a jupyter kernel like this:
jupyter-kernel \
--ip=0.0.0.0 \
--KernelManager.control_port=56406 \
--KernelManager.hb_port=56407 \
--KernelManager.iopub_port=56408 \
--KernelManager.shell_port=56409 \
--KernelManager.stdin_port=56410
It starts, and I see this output:
[KernelApp] Starting kernel 'python3'
[KernelApp] Connection file: /Users/jkitchin/Library/Jupyter/runtime/kernel-892382b5-8115-44ba-95cd-d8172ba848ac.json
however, the kernel json contains:
cat /Users/jkitchin/Library/Jupyter/runtime/kernel-892382b5-8115-44ba-95cd-d8172ba848ac.json
{
"shell_port": 55505,
"iopub_port": 55506,
"stdin_port": 55507,
"control_port": 55509,
"hb_port": 55508,
"ip": "0.0.0.0",
"key": "0a163fda-2b4963c994abc4277bdf58fa",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
which do not match the ports I specified. Am I missing something to make this happen?
答案1
得分: 1
这是翻译好的部分:
Answering my own question here. It turns out the ports were not configurable at the command line even though the documentation suggested they were. This was fixed in https://github.com/jupyter/jupyter_client/pull/956, and now it should work.
英文:
Answering my own question here. It turns out the ports were not configurable at the command line even though the documentation suggested they were. This was fixed in https://github.com/jupyter/jupyter_client/pull/956, and now it should work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论