jupyter notebook python怎么设置_jupyter notebook 的工作空间设置操作
Jupyter notebook 安裝后,啟動(dòng)后,默認(rèn)的工作空間是當(dāng)前用戶目錄。為了方便對(duì)文檔進(jìn)行管理,往往需要自行設(shè)置工作空間。下面介紹一種便捷的工作空間設(shè)置方法。
對(duì) Jupyter notebook 快捷方式進(jìn)行修改。右擊 jupyter notebook 快捷方式 -> 屬性 -> 把“目標(biāo)”中的 %USERPROFILE% 替換成你想要的目錄,eg:D:\python-workspace。
接下來(lái)雙擊 Jupyter notebook 運(yùn)行,就可以見(jiàn)證效果。
補(bǔ)充知識(shí):Running as root is not recommended. Use --allow-root to bypass
首先輸入,查看配置文件位置
[as-pc as]# jupyter notebook --generate-config --allow-root
Overwrite /root/.jupyter/jupyter_notebook_config.py with default config? [y/N]y
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
接下來(lái)打開(kāi)配置文件
gedit /root/.jupyter/jupyter_notebook_config.py
找到這一行
#c.NotebookApp.allow_root = False
去掉#,并修改成True即可解決root權(quán)限運(yùn)行的問(wèn)題
c.NotebookApp.allow_root =True
保存,重新運(yùn)行程序
jupyter notebook
設(shè)置訪問(wèn)密碼
打開(kāi) ipython 輸入
from notebook.auth import passwd
passwd()
然后根據(jù)提示輸入2次密碼
Enter password: ········
Verify password: ········
然后復(fù)制 ‘sha1:f5643****************************' 粘貼至配置文件(記得去掉 #)
c.NotebookApp.password = u'sha1:f5*****************************'
更多設(shè)置如下
c.NotebookApp.ip = 'localhost'
c.NotebookApp.open_browser = True(True:啟動(dòng)時(shí)自動(dòng)打開(kāi)瀏覽器,False:需手動(dòng)打開(kāi)瀏覽器訪問(wèn)http://localhost:8888/tree)
c.NotebookApp.port = 8888(端口設(shè)置)
以上這篇jupyter notebook 的工作空間設(shè)置操作就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
總結(jié)
以上是生活随笔為你收集整理的jupyter notebook python怎么设置_jupyter notebook 的工作空间设置操作的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: CAN总线技术 | 数据链路层03 -
- 下一篇: python协程asyncio 应用_P