本文主要介绍jupyter基本安装和配置。
使用环境:Ubuntu18 + Python3.6
安装Jupyter
python3 -m pip install --upgrade pip
python3 -m pip install jupyter --user
完成后,Jupyter安装在~/.local/bin
目录下。
运行Jupyter(如果提示找不到Jupyter,需要重启终端):
jupyter notebook
安装扩展
pip3 install jupyter_contrib_nbextensions --user
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
安装完成后,刷新浏览器显示如下:
扩展比较推荐的扩展有:
- Execute Time,单元格运行时间,使用Cython的时候,可以用来看编译是否完成。
- Hinterland, 代码补全。
修改多行输出:
进入C:\Users\username\.ipython\profile_default
目录(将其中username
替换真实用户名),创建ipython_config.py
文件,内容为:
c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"
保存后重启NoteBook,就可以输出多行了。
输出多行
版权声明:本文为「txfly」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://www.jianshu.com/p/5ad139fb500a
网友评论