Jupyter notebook and Octave kernel installation


Jupyter notebook 安裝

為了更加方便地寫 Python 代碼,還需要安裝 Jupyter notebook。
利用 pip 安裝 Jupyter notebook。
為什么要使用 Jupyter?參考: https://www.zhihu.com/question/37490497
Jupyter notebook: 一個交互式筆記本,支持運行 40 多種編程語言。
利用她來寫 Python,代碼和運行結果都可以保存下載,十分方便。

Open cmd

cd E:\Python\Python36\Scripts
pip install jupyter

配置自己的workspace
jupyter notebook --generate-config

打開 ".jupyter" 文件夾,可以看到里面有個配置文件
修改 ".jupyter\jupyter_notebook_config.py"
c.NotebookApp.notebook_dir = 'E:\Python\jupyter-notebook'

啟動
jupyter notebook

然后就可以在瀏覽器中看到 notebook的界面了。

Octave 安裝 for Jupyter Notebook

Matlab實在太貴,所以 Andrew Ng 推薦的完全開源免費的 Octave 是個好的替代物。

關於為什么要用Octave,而不是用別的Matlab代替品如Freemat, Spider等,這篇AskUbuntu里有非常詳盡的解答。
簡而言之:Octave是Matlab毫無疑問的最好代替品,語法相似性達95%以上,功能完善,且社區、文檔非常詳盡。
反之其它代替品,則要不就語法相似度低、要不就功能不全、要不就幾乎沒有文檔學習參考。

download Octave
http://wiki.octave.org/Octave_for_Microsoft_Windows

在本機已安裝Octave、Jupyter的情況下,進入Jupyter notebook的運行環境(系統或虛擬環境),輸入這些命令安裝:

pip install metakernel
pip install octave_kernel
python -m octave_kernel install

then, 添加 Octave 的環境變量 OCTAVE_EXECUTABLE= where is octave installed

then, 重啟Jupyter就可以看到多了一個Octave kernel了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM