将Jupyter Notebook的localhost:8888默认服务器更改为其他 [英] Change Jupyter Notebook's localhost:8888 default server with other
问题描述
我有两台通过lan连接的机器. 其他系统的IP地址是192.1xx.x.x 我想在我的机器上运行jupyter ipython查询,这可以在他的机器上执行. 在ipython notebook的开头,有一个黑屏,其中包含以下内容:
i have two machines connected via lan. other system's ip address is 192.1xx.x.x i want to run jupyter ipython query's on my machine which can be exexuted on his machine. at the start of ipython notebook, there is a black screen which contains this:
[I 11:12:52.802 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
我可以将其更改为我指定的位置吗?
can i change this to my specified location?
推荐答案
您可以在~/.jupyter/jupyter_notebook_config.py
中指定要让Jupyter运行的端口取消注释/编辑以下行:
You can specify the port you want Jupyter to run uncommenting/editing the following line in ~/.jupyter/jupyter_notebook_config.py
:
#c.NotebookApp.port = 8888
如果您没有jupyter_notebook_config.py
,请尝试运行jupyter notebook --generate-config
.有关Jupyter配置的更多详细信息,请参见此.
In case you don't have a jupyter_notebook_config.py
try running jupyter notebook --generate-config
. See this for further details on Jupyter configuration.
如果您要在远程计算机上访问Jupyter,也可以尝试让Jupyter在其默认端口上运行,并在所需端口上建立到本地计算机的SSH隧道,例如:
In case you are accessing Jupyter at a remote machine you can also try just leaving Jupyter running at its default port and make an SSH tunnel to your local machine at the port you want, e.g.:
ssh -fNL <new port>:localhost:8888 <your ssh config>
这篇关于将Jupyter Notebook的localhost:8888默认服务器更改为其他的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!