安裝
- 新建虛擬環(huán)境?Python虛擬環(huán)境virtualenvwrapper 安裝配置? (可選)
mkvirtualenv jupyter -p python3
- Pip 安裝
pip3 install jupyter
- 啟動
jupyter notebook --no-browser --port 8888
配置遠(yuǎn)程訪問
- 生成默認(rèn)配置文件
# 配置文件path為 ~/.jupyter/jupyter_notebook_config_backup.py
jupyter notebook --generate-config
- 設(shè)置密碼
jupyter notebook password
Enter password: #鍵入密碼朱灿,不顯示的
Verify password: #再次重復(fù)鍵入密碼
# 密碼寫入到~/.jupyter/jupyter_notebook_config.json
ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: '************'
- 復(fù)制方法1文件中的password或者方法2的輸出的密文字符串
- 編輯
?~/.jupyter/jupyter_notebook_config_backup.py
?加入
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'***...剛才復(fù)制的那個(gè)密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #可自行指定一個(gè)端口, 訪問時(shí)使用該端口
- 啟動
- 后臺啟動,編寫腳本?~/cmd/jupyter.sh?
cd /home/user_name
[python_path]/bin/jupyter notebook > jupyter.log 2>&1 &
alias jupyter="bash ~/cmd/jupyter.sh"
source ~/.bash_profile
jupyter
lsof -i:8888
kill -9 [pid]
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者