日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Windows下的Jupyter Notebook 安装与自定义启动(图文详解)

發(fā)布時間:2025/3/20 windows 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows下的Jupyter Notebook 安装与自定义启动(图文详解) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、Jupyter Notebook pip

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

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

2、Jupyter notebook 安裝

命令行窗口輸入: pip install jupyter

切換到 D:\SoftWare\Python\Python36\Scripts目錄下,

當然,若大家是默認安裝的話,則在C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts?目錄下 。

或者將該目錄添加到?path,就不用切換了。?
?

我這里,因為考慮到機器學習深度學習那邊,已經(jīng)安裝了Anaconda2和Anaconda3,所以這邊的數(shù)據(jù)分析所用的python3.6.1就不添加到path了。每次去切換到這個目錄來,也不麻煩。

 

?

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\ScriptsD:\SoftWare\Python\Python36\Scripts>pip install jupyter

?

?

?

?

安裝成功。

3、?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 allkernels (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

同時,默認瀏覽器會打開 Jupyter notebook 窗口。 說明 Jupyter notebook 安裝成功了。

?

?

4、配置 Jupyter notebook?

?jupyter notebook --generate-config

運行之前

打開“.jupyter”文件夾,可以看到里面有個配置文件。

?

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\ScriptsD:\SoftWare\Python\Python36\Scripts>jupyter notebook --generate-config Writing default config to: C:\Users\Administrator\.jupyter\jupyter_notebook_conf ig.pyD:\SoftWare\Python\Python36\Scripts>

修改jupyter_notebook_config.py配置文件


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

比如,這里要變更為

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

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

?

?

?

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

jupyter notebook的自定義啟動(變了)
  配置文件修改成后,就可以啟動 jupyter notebook 了,命令行窗口中輸入 jupyter notebook,
  默認瀏覽器就會打開一個頁面

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 allkernels (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)在是

?

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\ScriptsD:\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 allkernels (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

?

轉(zhuǎn)自:http://www.cnblogs.com/zlslch/p/6984403.html

總結(jié)

以上是生活随笔為你收集整理的Windows下的Jupyter Notebook 安装与自定义启动(图文详解)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。