不要總是等待,而是去創造
方法一
ipython notebook升級成了jupyter notebook,在4.x之后的版本,jupyter提供了jupyter-nbextension命令來安裝和啟用這些擴展,
安裝擴展方便了很多。
jupyter-nbextension install [--user] EXTENSION
install 后面的參數是擴展所在的文件夾,按照此思路安裝table of content:
## download mkdir toc cd toc wget https://raw.githubusercontent.com/minrk/ipython_extensions/master/nbextensions/toc.js wget https://raw.githubusercontent.com/minrk/ipython_extensions/master/nbextensions/toc.css ## install and enable cd .. jupyter-nbextension install --user toc jupyter-nbextension enable toc/toc
思路是將這里的toc.js和toc.css的文件下載並copy到一個名為toc的文件夾下,然后在toc文件夾上一層路徑下執行:
jupyter-nbextension install --user toc jupyter-nbextension enable toc/toc
也可以用該思路安裝其他的擴展
思路二
使用 'nbextensions' server extension
,這個repo里面包含了一些擴展並且其中有一個叫 'nbextensions' server的擴展,使用這個擴展可以再打開jupyter notebook的時候打開一個網頁界面,在該界面可以勾選相應的擴展就可以啟用或者停用了。
1.下載這個repo
2.安裝。
安裝可以使用python setup.py install 的形式,也可以使用conda
The conda package can be built by running
conda build IPython-notebook-extensions
in the parent directory, and then doing aconda install nbextensions
要注意命名,IPython-notebook-extensions是該repo的根目錄下的唯一文件夾,直接下載的會包含master,conda install后面的是前面build成功的一個壓縮文件,該壓縮文件的位置一般會在build成功后提示。
我這里的測試是使用python setup.py install 的形式安裝沒有成功,但是使用conda卻成功了。當安裝成功后就可以通過訪問一個url來看到這個擴展管理的界面了
補充
思路二已經不適用,詳情請使用該安裝包:
jupyter_contrib_nbextensions
參考文件: