2016-11-02 179 views
1

我有兩臺機器通過LAN連接。 其他系統的IP地址是192.1xx.x.x 我想在我的機器上運行jupyter ipython查詢,它可以在他的機器上執行。 在IPython的筆記本電腦開始,就包含這個黑屏:更改Jupyter Notebook的本地主機:8888默認服務器與其他

[I 11:12:52.802 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/ 

我可以將其更改爲我指定的位置?

回答

5

您可以指定要Jupyter運行取消註釋/編輯下面的行~/.jupyter/jupyter_notebook_config.py端口:

#c.NotebookApp.port = 8888 

如果你沒有jupyter_notebook_config.py嘗試運行jupyter notebook --generate-config。有關Jupyter配置的更多詳細信息,請參閱this

如果你在一臺遠程機器訪問Jupyter你也可以嘗試只留下Jupyter其默認端口上運行,並在您需要的端口做一個SSH隧道到本地機器上,如:

ssh -fNL <new port>:localhost:8888 <your ssh config> 
3

首先,你需要通過鍵入生成一個配置文件:

$> jupyter notebook --generate-config 
Writing default config to: /{home-directory}/.jupyter/jupyter_notebook_config.py 

接下來你需要編輯配置以更改端口號:

vi /{home-directory}/.jupyter/jupyter_notebook_config.py 
在該行

查找以下行(默認情況下注釋掉)和發表意見,並更改端口號:

(default configuration) 
## The port the notebook server will listen on. 
# c.NotebookApp.port = 8888 

(comment removed, port changed) 
## The port the notebook server will listen on. 
c.NotebookApp.port = 9999 
相關問題