安装nbextensions可提高jupyter notebook效率,安装步骤如下:

1、pip 方式安装:

(gluon) [root@localhost ~]# pip install jupyter_contrib_nbextensions
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting jupyter_contrib_nbextensions
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/33/f0/6e2c00afda860f655fbf0f795f7310bdbf12122846344dfdc803fc7455d5/jupyter_contrib_nbextensions-0.5.1-py2.py3-none-any.whl (20.9MB)

...

2、安装关联的 JavaScript 和 CSS 文件:安装关联的 JavaScript 和 CSS 文件:

(gluon) [root@localhost ~]# jupyter contrib nbextension install

...

[I 22:29:28 InstallContribNbextensionsApp] Installing jupyter_contrib_nbextensions items to config in /usr/local/etc/jupyter
Enabling: jupyter_nbextensions_configurator
- Writing config: /usr/local/etc/jupyter
- Validating...
jupyter_nbextensions_configurator 0.4.1 OK
Enabling notebook nbextension nbextensions_configurator/config_menu/main...
Enabling tree nbextension nbextensions_configurator/tree_tab/main...
[I 22:29:28 InstallContribNbextensionsApp] Enabling notebook extension contrib_nbextensions_help_item/main...
[I 22:29:28 InstallContribNbextensionsApp] - Validating: OK
[I 22:29:28 InstallContribNbextensionsApp] - Editing config: /usr/local/etc/jupyter/jupyter_nbconvert_config.json
[I 22:29:28 InstallContribNbextensionsApp] -- Configuring nbconvert template path
[I 22:29:28 InstallContribNbextensionsApp] -- Configuring nbconvert preprocessors
[I 22:29:28 InstallContribNbextensionsApp] - Writing config: /usr/local/etc/jupyter/jupyter_nbconvert_config.json
[I 22:29:28 InstallContribNbextensionsApp] -- Writing updated config file /usr/local/etc/jupyter/jupyter_nbconvert_config.json

3、重启jupyter notebook服务

4、在浏览器访问jupyter notebook 即可看到nbextensions标签

5、使用:(以Code prettify为例,Code prettify是代码规范化扩展工具,其支持程序为yapf)

(1)在nbextensions标签页面勾选Code prettify,勾选后,在jupyter note页面工具栏可看到新增一个小锤样图标。

(2)安装扩展所需插件程序(这一步不一定是必须的,上一步的勾选完成后,系统应能自动下载和配置相关需求扩展程序。若出现错误,根据提示进行安装):

(gluon) [root@localhost ~]# pip install yapf
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting yapf
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7c/21/534d143afd3df9cae9b21674fcc32207cb80cfb3de56b89ef7a37c746cca/yapf-0.29.0-py2.py3-none-any.whl (185kB)
|████████████████████████████████| 194kB 353kB/s 
Installing collected packages: yapf
Successfully installed yapf-0.29.0

(3)使用:选中一个cell,点击该小锤样图标,即可看到代码被规范化。若先按下Shift键不放,再点击该小锤样图标,则该页面所有cell的代码都全部被规范化。

快捷键:Ctrl + L (规范化一个cell内代码);Ctrl + Shift + L  (规范化全部cell内的代码)

相关参考:《推荐Variable Inspector | DeBug工具PySnooper | 暗色系个性化》https://blog.csdn.net/Suexy_/article/details/102516961

jupyter notebook 安装扩展nbextensions的更多相关文章

  1. Jupyter notebook安装扩展插件

    1. 安装Jupyter Notebook pip install jupyter 2. 安装Jypyter Notebook扩展包 pip install jupyter_contrib_nbext ...

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

    不多说,直接上干货! 前期博客 Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解) 这是我自定义的Python 的安装目录 (D:\SoftWare\ ...

  3. Windows下的Jupyter Notebook 安装与自定义启动

    1.Jupyter Notebook 和 pip 为了更加方便地写 Python 代码,还需要安装 Jupyter notebook. 利用 pip 安装 Jupyter notebook. 为什么要 ...

  4. 全真教程:Windows环境Jupyter Notebook安装、运行和工作文件夹配置

    全真教程:Windows环境Jupyter Notebook安装.运行和工作文件夹配置 @ 目录 全真教程:Windows环境Jupyter Notebook安装.运行和工作文件夹配置 一.Jupyt ...

  5. IPython与Jupyter notebook 安装与配置,插件扩展,主题,PDF输出

    基于 python2.7.13 32-bit版本安装 1.安装pyreadline https://pypi.python.org/pypi/pyreadline 下载对应的32位版本 安装Micro ...

  6. 【机器学习实践】Jupyter Notebook安装 侧边导航栏功能 操作及其他常用扩展功能介绍

    安装过程:  1. 首先我们引入jupyter_contrib_nbextension这个第三方库. 2. 在Anaconda Promot中输入命令: pip install jupyter_con ...

  7. 如何为 Jupyter Notebook 安装代码提示功能

    按照上一篇博客安装完 Python 和 Jupyter Notebook 后,我们已经可以使用 Notebook 愉快的编写 Python 代码了,但是发现它不像其他编辑器那样会弹出代码提示,这稍微有 ...

  8. jupyter notebook安装/代码补全/支持golang 踩坑记

    安装(不要用root) 安装anaconda3,然后ln -s bin目录下的jupyter命令到/usr/bin目录下 生成密码备用 敲ipython进入交互终端 In [1]: from note ...

  9. jupyter notebook 安装配置使用,+目录插件安装

    1.安装 pip3 install jupyter 2.配置 2.1. 生成一个 notebook 配置文件 jupyter notebook --generate-config /root/.jup ...

随机推荐

  1. Spring学习笔记(八)Spring Data JPA学习

    ​ jpa简单的命名规则如下,这个不多做介绍,放在这里也是给自己以后查找起来方便,这篇文章主要介绍之前一直忽略了的几个点,像@NoRepositoryBean这个注解,以及怎么自定义Repositor ...

  2. Jmeter系列(11)- 并发线程组Concurrency Thread Group详解

    如果你想从头学习Jmeter,可以看看这个系列的文章哦 https://www.cnblogs.com/poloyy/category/1746599.html Concurrency Thread ...

  3. C:简单实现BaseCode64编码

    What is Base64? 前言 目前来看遇到过Base 16.Base 32.Base 64的编解码,这种编码格式是二进制和文本编码转化,是对称并且可逆的转化.Base 64总共有64个ASCI ...

  4. 正则表达式在java中的用法

    /** * 测试正则表达式的基本用法 Pattern 和 Matcher * @author 小帆敲代码 * */public class Demo01 {  public static void m ...

  5. [hdu5418 Victor and World]floyd + 状压DP 或 SPFA

    题意:给n个点,m条边,每次只能沿边走,花费为边权值,求从1出发经过所有其它点≥1次最后回到1的最小花费. 思路: 状压DP.先用Floyd得到任意两点间的最短距离,转移时沿两个点的最短路转移.此时的 ...

  6. Python 的缩进是不是反人类的设计?

    前些天,我写了<Python为什么使用缩进来划分代码块?>,文中详细梳理了 Python 采用缩进语法的 8 大原因.我极其喜欢这种简洁优雅的风格,所以对它赞美有加. 然而文章发出去后,非 ...

  7. 黑马程序员_毕向东_Java基础视频教程——算术运算符小点(随笔)

    算术运算符小点 ​ 取模 class Test{ public static void main(String[] args){ System.out.println( 1 % -5); System ...

  8. 使用windows(win7和win10),最好用chocolatey

    Win10平台使用PowerShell命令行choco来安装所需开源软件. 步骤如下: 打开Chocolatey 官方网站,The package manager for windows,这很巨硬. ...

  9. python之模块、类、对象

    模块就像字典 字典是python中唯一映射关系,它用一个事物对应另外一个事物,也就是所谓的key->value. 模块包含一些变量和函数,可以导入,并且可以用点(·)来操作访问变量和函数. 记住 ...

  10. Element Form表单实践(上)

    作者:小土豆biubiubiu 博客园:https://www.cnblogs.com/HouJiao/ 掘金:https://juejin.im/user/58c61b4361ff4b005d9e8 ...