1. jupyter notebook 安裝
•創(chuàng)建 jupyter 目錄
mkdir jupytercd jupyter/
•創(chuàng)建獨(dú)立的 Python3 運(yùn)行環(huán)境,并激活進(jìn)入該環(huán)境
virtualenv --python=python3 --no-site-packages venvsource venv/bin/activate
•安裝 jupyter
pip install jupyter
2. jupyter notebook 配置
•創(chuàng)建 notebooks 目錄
mkdir notebooks
用于保存網(wǎng)頁(yè)端創(chuàng)建的 ipynb 文件。
•生成配置文件
jupyter notebook --generate-config
生成的配置文件保存在當(dāng)前用戶的 .jupyter 目錄下。
•生成密碼密文
python -c "import IPython; print(IPython.lib.passwd())"
執(zhí)行后輸入密碼,生成類似 'sha1:xxx:xxx' 的密文。
•修改配置文件
c.NotebookApp.allow_remote_access = True # 允許遠(yuǎn)程訪問(wèn)c.NotebookApp.ip = '*' # 允許任意ip訪問(wèn)此服務(wù)器c.NotebookApp.password = 'sha1:xxx:xxx' # 上一步生成的密文c.NotebookApp.open_browser = False # 運(yùn)行時(shí)不打開(kāi)本機(jī)瀏覽器c.NotebookApp.allow_root =True # 允許使用 root 權(quán)限運(yùn)行c.NotebookApp.port = 8888 # 指定 jupyter notebook 使用的端口c.ContentsManager.root_dir = 'notebooks' # 指定 ipynb 等文件的保存目錄
3. 啟動(dòng) jupyter notebook
•直接運(yùn)行
jupyter notebook
•后臺(tái)運(yùn)行
nohup jupyter notebook > ~/jupyter/jupyter.log 2>&1 &
總結(jié)
以上所述是小編給大家介紹的Python3 jupyter notebook 服務(wù)器搭建,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林站長(zhǎng)站網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選