參考
- https://blog.csdn.net/qq_23869697/article/details/124178117
- https://blog.csdn.net/m0_37201243/article/details/122531675
1、安裝notebook
pip install notebook
2、生成配置文件
jupyter notebook --generate-config
生成的配置文件,在linux下的路徑一般是“/home/USERNAME/.jupyter/jupyter_notebook_config.py”
3、配置密碼
jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
4、編輯配置文件
vim ~/.jupyter/jupyter_notebook_config.py
# 在 jupyter_notebook_config.py 文件中添加以下配置
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 8888
c.NotebookApp.notebook_dir = '/root/jupyter_projects' #這里是設(shè)置Jupyter的根目錄
c.NotebookApp.allow_root = True # 為了安全,Jupyter默認(rèn)不允許以root權(quán)限啟動(dòng)jupyter
5、啟動(dòng)notebook后臺(tái)運(yùn)行
nohup jupyter notebook --port=12345 --no-browser > logs/jupyter_notebook.log 2>&1 &
上面的指令也可以添加上 --allow-root
6、在本地瀏覽器訪問
在瀏覽器中輸入?http://ip:12345文章來源:http://www.zghlxwxcb.cn/news/detail-653535.html
7、查看端口是不是被占用文章來源地址http://www.zghlxwxcb.cn/news/detail-653535.html
# 查看端口12345是不是被其他進(jìn)程占用了
netstat -lnp | grep 12345
# 也可以用下面的方式查看 端口12345 是不是被占用了
ps -ef | grep 12345
到了這里,關(guān)于在服務(wù)器開jupyter notebook server的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!