IPython與Jupyter notebook 安裝與配置,插件擴展,主題,PDF輸出題文章

基于 python2.7.13 32-bit版本安裝

1、安裝pyreadline

https://pypi.python.org/pypi/pyreadline

下載對應的32位版本

安裝Microsoft Visual C++ Compiler for Python 2.7 并安裝

http://www.microsoft.com/en-us/download/details.aspx?id=44266

2、用pip安裝iPython

進入目錄 c:\Python27\Scripts>

輸入命令: pip install ipython

2.1 或者從git安裝iPython

https://github.com/ipython/ipython.git

把ipython.git pull 下來,checkout 到5.1分支(適用于Python2.7)。

使用cmd進入ipython目錄,輸入 python setup.py install 即可

檢查iPython是否安裝成功

命令行輸入 ipython 即可進入ipython

命令行輸入 ipython --pylab

ipython會自動importSciPy,NumPy和matplotlib包,也就是不需要在命令輸入 from numpy import * 等命令

3、安裝notebook

pip install jupyter

安裝成功后,命令行輸入:

jupyter notebook

http://localhost:8888/ 檢查notebook服務器是否已經(jīng)啟動

4、查看已安裝的包

pip list

5、安裝擴展

https://github.com/ipython-contrib/jupyter_contrib_nbextensions

安裝命令:

pip install jupyter_contrib_nbextensions

(或者用命令:pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master)

jupyter contrib nbextension install --user

運行Jupyter Notebook, 在打開的Notebook界面里, 你會發(fā)現(xiàn)多了一個Nbextensions,勾選Table of Contents (有的版本是toc2). 然后創(chuàng)建或者打開一個Jupter Notebook

如果是anaconda,可以使用命令:

conda install -c conda-forge jupyter_contrib_nbextensions

5、安裝Jupyter themes

https://github.com/dunovank/jupyter-themes

安裝命令:

pip install jupyterthemes

安裝完后,直接cmd下,使用 jt -l 查看所有 themes,使用 jt -t grade3 -T -N 啟用不同的themes。

重啟jupyter 生效

6、輸出PDF

a、安裝pandoc

https://github.com/jgm/pandoc/releases/tag/1.19.2.1

b、安裝MiKTeX

https://miktex.org/download

c、安裝 GNU make for windows

http://gnuwin32.sourceforge.net/packages/make.htm

d、把上面安裝好的軟件路徑,全部添加到環(huán)境變量里面

e、PDF支持中文

C:\Python27\Lib\site-packages\nbconvert\templates\latex\article.tplx

把?\documentclass[11pt]{article} 修改為 ?\documentclass[11pt]{ctexart} 即可?。?!

Pandoc 支持中文

pandoc infile.md -o outfile.pdf --latex-engine=xelatex -V mainfont="SimSun"

搬運自http://www.cnblogs.com/McKean/p/6249112.html

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容