摘要:搭建Python3 jupyter notebook。
激活Python3后,進入Python交互環境
1. 登陸遠程服務器
2. 生成配置文件
1. $jupyter notebook --generate-config
3. 生成密碼
打開ipython
,創建一個密文的密碼:
1. In [1]: from notebook.auth import passwd
2. In [2]: passwd()
3. Enter password:
4. Verify password:
5. Out[2]: ' sha1:fa0dde171852:7afe4911d125a73f091298be12aa0c199e3b9350'
把生成的密文‘sha:ce…’復制下來
4. 修改默認配置文件
$vim ~/.jupyter/jupyter_notebook_config.py
服務器是windows的話是在
C:\Users\yourusername\.jupyter\jupyter_notebook_config.py
進行如下修改:
c.NotebookApp.ip=' *' #所有ip都可以訪問 c.NotebookApp.password=u'sha1:fa0dde171852:7afe4911d125a73f091298be12aa0c199e3b9350' c.NotebookApp.open_browser = False c.NotebookApp.port =8888 #隨便指定一個端口
5. 啟動jupyter notebook:
1. $jupyter notebook
6. 遠程訪問
此時應該可以直接從本地瀏覽器直接訪問http://address_of_remote:8888
就可以看到jupyter的登陸界面。
會提示輸入密碼,這個密碼是剛才第二步生成的密碼
我們的密碼是12345678