- 1.安裝jupyter notebook
jupyter notebook安裝坑: 或者miniconda創(chuàng)建環(huán)境后,在環(huán)境里用
conda install jupyter
而不是
pip install jupyter
- 2.生成配置文件
jupyter notebook --generate-config
- 生成密碼
命令行輸入ipython
ipython
- 生成密碼
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:ce23d945972f:34769685a7ccd3d08c84a18c63968a41f1140274'
把生成的密文‘sha:ce…’復(fù)制下來(lái)
- 修改默認(rèn)配置文件,
$vim ~/.jupyter/jupyter_notebook_config.py
在空白處插入
c.NotebookApp.ip='*'
#如果有問(wèn)題改成 c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.password = u'sha:ce...剛才復(fù)制的那個(gè)密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #隨便指定一個(gè)端口
- 5 重新啟動(dòng)jupyter notebook
- 6 在本地電腦瀏覽器輸入
localhost:8888
localhost為服務(wù)器IP