溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

jupyter怎么設(shè)置notebook 的工作空間

發(fā)布時(shí)間:2020-08-01 13:52:18 來源:億速云 閱讀:244 作者:小豬 欄目:開發(fā)技術(shù)

這篇文章主要講解了jupyter怎么設(shè)置notebook 的工作空間,內(nèi)容清晰明了,對(duì)此有興趣的小伙伴可以學(xué)習(xí)一下,相信大家閱讀完之后會(huì)有幫助。

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。

接下來雙擊 Jupyter notebook 運(yù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

接下來打開配置文件

gedit /root/.jupyter/jupyter_notebook_config.py

找到這一行

#c.NotebookApp.allow_root = False

去掉#,并修改成True即可解決root權(quán)限運(yùn)行的問題

c.NotebookApp.allow_root =True

保存,重新運(yùn)行程序

jupyter notebook

設(shè)置訪問密碼

打開 ipython 輸入

from notebook.auth import passwd
passwd()

然后根據(jù)提示輸入2次密碼

Enter password: ········
Verify password: ········

jupyter怎么設(shè)置notebook 的工作空間

然后復(fù)制 ‘sha1:f5643****************************' 粘貼至配置文件(記得去掉 #)

c.NotebookApp.password = u'sha1:f5*****************************'

更多設(shè)置如下

c.NotebookApp.ip = 'localhost'
c.NotebookApp.open_browser = True(True:?jiǎn)?dòng)時(shí)自動(dòng)打開瀏覽器,F(xiàn)alse:需手動(dòng)打開瀏覽器訪問http://localhost:8888/tree)
c.NotebookApp.port = 8888(端口設(shè)置)

看完上述內(nèi)容,是不是對(duì)jupyter怎么設(shè)置notebook 的工作空間有進(jìn)一步的了解,如果還想學(xué)習(xí)更多內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI