国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > Python > 正文

Windows下的Jupyter Notebook 安裝與自定義啟動(dòng)(圖文詳解)

2020-01-04 15:50:19
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

VEVB武林網(wǎng)小編注:如果不是特殊需要建議安裝 Anaconda3 即可,自帶Jupyter Notebook 。

這是我自定義的Python 的安裝目錄 (D:/SoftWare/Python/Python36/Scripts)

1、Jupyter Notebook 和 pip

  為了更加方便地寫(xiě) Python 代碼,還需要安裝 Jupyter notebook。 利用 pip 安裝 Jupyter notebook。
  為什么要使用 Jupyter?參考: https://www.zhihu.com/question/37490497

  pip: Python 的包管理工具,安裝 Python 的同時(shí)已經(jīng)安裝好了。
  Jupyter notebook: 一個(gè)交互式筆記本,支持運(yùn)行 40 多種編程語(yǔ)言。 利用她來(lái)寫(xiě) Python,代碼和運(yùn)行結(jié)果都可以保存下載,十分方便。

2、Jupyter notebook 安裝

  命令行窗口輸入: pip install jupyter
  切換到 D:/SoftWare/Python/Python36/Scripts目錄下,

  當(dāng)然,若大家是默認(rèn)安裝的話(huà),則在C:/Users/Administrator/AppData/Local/Programs/Python/Python36/Scripts 目錄下 。

   或者將該目錄添加到 path,就不用切換了。
  我這里,因?yàn)榭紤]到機(jī)器學(xué)習(xí)深度學(xué)習(xí)那邊,已經(jīng)安裝了Anaconda2和Anaconda3,所以這邊的數(shù)據(jù)分析所用的python3.6.1就不添加到path了。每次去切換到這個(gè)目錄來(lái),也不麻煩。

Jupyter,Notebook

Jupyter,Notebook

Microsoft Windows [版本 6.1.7601]
版權(quán)所有 (c) 2009 Microsoft Corporation。保留所有權(quán)利。

C:/Users/Administrator>cd /d D:/

D:/>cd D:/SoftWare/Python/Python36/Scripts

D:/SoftWare/Python/Python36/Scripts>pip install jupyter

Jupyter,Notebook

 Jupyter,Notebook

Jupyter,Notebook

  Jupyter,Notebook

 

 Jupyter,Notebook

安裝成功。

3、 jupyter notebook的啟動(dòng)

命令行窗口輸入: jupyter notebook

Jupyter,Notebook

D:/SoftWare/Python/Python36/Scripts>jupyter notebook
[I 10:37:02.828 NotebookApp] Serving notebooks from local directory: D:/SoftWare
/Python/Python36/Scripts
[I 10:37:02.828 NotebookApp] 0 active kernels
[I 10:37:02.828 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d1050b0d
[I 10:37:02.829 NotebookApp] Use Control-C to stop this server and shut down all
kernels (twice to skip confirmation).
[C 10:37:02.833 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d10
50b0d
[I 10:37:03.628 NotebookApp] 302 GET / (::1) 1.00ms
[I 10:37:03.647 NotebookApp] 302 GET /tree? (::1) 5.00ms
[I 10:37:05.535 NotebookApp] Accepting one-time-token-authenticated connection f
rom ::1

同時(shí),默認(rèn)瀏覽器會(huì)打開(kāi) Jupyter notebook 窗口。 說(shuō)明 Jupyter notebook 安裝成功了。

Jupyter,Notebook

 

 Jupyter,Notebook

4、配置 Jupyter notebook

jupyter notebook --generate-config

運(yùn)行之前

Jupyter,Notebook

打開(kāi)“.jupyter”文件夾,可以看到里面有個(gè)配置文件。

Jupyter,Notebook

Microsoft Windows [版本 6.1.7601]
版權(quán)所有 (c) 2009 Microsoft Corporation。保留所有權(quán)利。

C:/Users/Administrator>cd /d D:/

D:/>cd D:/SoftWare/Python/Python36/Scripts

D:/SoftWare/Python/Python36/Scripts>jupyter notebook --generate-config
Writing default config to: C:/Users/Administrator/.jupyter/jupyter_notebook_conf
ig.py

D:/SoftWare/Python/Python36/Scripts>

修改jupyter_notebook_config.py配置文件

 打開(kāi)這個(gè)配置文件,找到“c.NotebookApp.notebook_dir=……”,把路徑改成自己的工作目錄。

Jupyter,Notebook

比如,這里要變更為

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'D:/Code/jupyter-notebook'

,當(dāng)然,文件夾 jupyter-notebook 需要自己創(chuàng)建好。

Jupyter,Notebook

Jupyter,Notebook

Jupyter,Notebook

配置文件修改完成后, 以后在 jupyter notebook 中寫(xiě)的代碼等都會(huì)保存在自己創(chuàng)建的目錄中。

jupyter notebook的自定義啟動(dòng)(變了)
  配置文件修改成后,就可以啟動(dòng) jupyter notebook 了,命令行窗口中輸入 jupyter notebook,
  默認(rèn)瀏覽器就會(huì)打開(kāi)一個(gè)頁(yè)面

jupyter notebook的啟動(dòng)
  命令行窗口輸入: jupyter notebook

  以前是

Jupyter,Notebook

D:/SoftWare/Python/Python36/Scripts>jupyter notebook
[I 10:37:02.828 NotebookApp] Serving notebooks from local directory: D:/SoftWare
/Python/Python36/Scripts
[I 10:37:02.828 NotebookApp] 0 active kernels
[I 10:37:02.828 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d1050b0d
[I 10:37:02.829 NotebookApp] Use Control-C to stop this server and shut down all
kernels (twice to skip confirmation).
[C 10:37:02.833 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d10
50b0d
[I 10:37:03.628 NotebookApp] 302 GET / (::1) 1.00ms
[I 10:37:03.647 NotebookApp] 302 GET /tree? (::1) 5.00ms
[I 10:37:05.535 NotebookApp] Accepting one-time-token-authenticated connection f
rom ::1

現(xiàn)在是

Jupyter,Notebook

Microsoft Windows [版本 6.1.7601]
版權(quán)所有 (c) 2009 Microsoft Corporation。保留所有權(quán)利。

C:/Users/Administrator>cd /d D:/

D:/>cd D:/SoftWare/Python/Python36/Scripts

D:/SoftWare/Python/Python36/Scripts>jupyter notebook
[I 10:59:58.326 NotebookApp] Serving notebooks from local directory: D:/Code/jup
yter-notebook
[I 10:59:58.327 NotebookApp] 0 active kernels
[I 10:59:58.327 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5fdc774
[I 10:59:58.328 NotebookApp] Use Control-C to stop this server and shut down all
kernels (twice to skip confirmation).
[C 10:59:58.332 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5f
dc774
[I 10:59:59.532 NotebookApp] Accepting one-time-token-authenticated connection f
rom ::1

Jupyter,Notebook

當(dāng)然,其實(shí)啊,這個(gè)玩意非常的簡(jiǎn)單和方便。關(guān)于修改名字、上傳等操作

常見(jiàn)問(wèn)題及解決方案

如何添加 Path?
計(jì)算機(jī)-右擊-單機(jī)“屬性”

單機(jī)“高級(jí)系統(tǒng)設(shè)置”

常見(jiàn)問(wèn)題及解決方案

如何添加 Path?
計(jì)算機(jī)-右擊-單機(jī)“屬性”

單機(jī)“高級(jí)系統(tǒng)設(shè)置”

Jupyter,Notebook

單機(jī)“環(huán)境變量”

Jupyter,Notebook

找到系統(tǒng)變量 path,編輯

在最后加上 2 個(gè)路徑:

C:/Users/Administrator/AppData/Local/Programs/Python/Python36
C:/Users/Administrator/AppData/Local/Programs/Python/Python36/Scripts

  說(shuō)明:以上默認(rèn)安裝路徑,每個(gè)電腦上是類(lèi)似的,找到復(fù)制這個(gè)路徑加到 Path 中即可

  我的路徑是已經(jīng)改了

jupyter notebook 閃退問(wèn)題

  解決辦法:更換默認(rèn)瀏覽器。 ,建議用谷歌瀏覽器或者火狐瀏覽器


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到python教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 大洼县| 宣化县| 洮南市| 仙桃市| 林州市| 乐至县| 鹰潭市| 阳曲县| 湖州市| 潼南县| 杨浦区| 德安县| 禹城市| 宁国市| 临江市| 通州市| 鄂尔多斯市| 松阳县| 盐池县| 曲阜市| 揭东县| 仪陇县| 千阳县| 安仁县| 中超| 霍州市| 罗源县| 焦作市| 项城市| 清远市| 彝良县| 内江市| 自贡市| 攀枝花市| 阿图什市| 客服| 丽水市| 稻城县| 游戏| 黎平县| 凌云县|