A server extension for jupyter notebookwhich provides configuration interfaces for notebook extensions (nbextensions).
The jupyter_nbextensions_configurator
jupyter server extension providesgraphical user interfaces for configuring which nbextensions are enabled(load automatically for every notebook).In addition, for nbextensions which include an appropriate yaml descriptor file(see below), the interface also renders their markdown readme files, andprovides controls to configure the nbextensions' options.
This project was spun out of work fromipython-contrib/IPython-notebook-extensions
.
For those using conda, you can now get jupyter_nbextensions_configurator
fromthe excellent conda-forgechannel in a single command:
conda install -c conda-forge jupyter_nbextensions_configurator
For those not using conda, the installation has two steps:
Installing the pip package. This should be as simple as
pip install jupyter_nbextensions_configurator
Configuring the notebook server to load the server extension. A jupyter
subcommand is provided for this. You can enable the serverextension and theconfigurator nbextensions listed below for the current user with
jupyter nbextensions_configurator enable --user
The command accepts the same flags as the jupyter serverextension
commandprovided by notebook versions >= 4.2, including --system
to enable insystem-wide config (the default), or --sys-prefix
to enable in configfiles inside python's sys.prefix
, such as for a virtual environment.The provided jupyter nbextensions_configurator
command can also be usedto disable
.
Once installed, you'll need to restart the notebook server. Once restarted, youshould be able to find the configurator user interfaces as described below.
Once jupyter_nbextensions_configurator
is installed and enabled, and yournotebook server has been restarted, you should be able to find the nbextensionsconfiguration interface at the url <base_url>nbextensions
, where<base_url>
is described below (for simple installs, it's usually just /
, sothe UI is at /nbextensions
).
For most single-user notebook servers, the dashboard (the file-browser or'tree' view) is at
http://localhost:8888/tree
So the base_url
is the part between the host (http://localhost:8888
) andtree
, so in this case it's the default value of just /
.If you have a non-default base url (such as with JupyterHub), you'll need toprepend it to the url. So, if your dashboard is at
http://localhost:8888/custom/base/url/tree
then you'll find the configurator UI page at
http://localhost:8888/custom/base/url/nbextensions
In addition to the main standalone page, the nbextensions configuratorinterface is also available as a tab on the dashboard:
The dashboard tab is provided via an nbextension called"Nbextensions dashboard tab", with requirejs urinbextensions_configurator/tree_tab/main
.Since version 0.2.0, this nbextension is enabled by default on enablingthe jupyter_nbextensions_configurator
serverextension, but it can be disabledas with any other nbextension if you don't want to use it.
jupyter_nbextensions_configurator
provides a second small nbextension, whichsimply adds an item to the notebook-view edit menu, which links to theconfigurator UI page:
Similarly to the tree tab nbextension detailed above, since version0.2.0, the edit menu item nbextension is enabled by default whenenabling the main jupyter_nbextensions_configurator
serverextension, but canbe disabled at any time in the same way as other nbextensions.
You don't need to know about the yaml files in order simply to usejupyter_nbextensions_configurator
.An nbextension is 'found' by the jupyter_nbextensions_configurator
serverextension when a special yaml file describing the nbextension and its optionsis found in the notebook server's nbextensions_path
.The yaml file can have any name with the file extension .yaml
or .yml
, anddescribes the nbextension and its options tojupyter_nbextensions_configurator
.
The case-sensitive keys in the yaml file are as follows:
Type
, (required) a case-sensitive identifier, must be IPython Notebook Extension
or Jupyter Notebook Extension
Main
, (required) the main javascript file that is loaded, typically main.js
Name
, the name of the nbextensionSection
, which view the nbextension should be loaded in (defaults to notebook
, but can alternatively be tree
, edit
, or to load in all views, common
).Description
, a short explanation of the nbextensionLink
, a URL for more documentation. If this is a relative url with a .md
file extension (recommended!), the markdown readme is rendered in the configurator UI.Icon
, a URL for a small icon for the configurator UI (rendered 120px high, should preferably end up 400px wide. Recall HDPI displays may benefit from a 2x resolution icon).Compatibility
, Jupyter major version compatibility, e.g. 3.x
or 4.x
, 3.x 4.x
, 3.x, 4.x, 5.x
Parameters
, an optional list of configuration parameters. Each item is a dictionary with (some of) the following keys
name
, (required) the name used to store the configuration variable in the config json. It follows a json-like structure, so you can use .
to separate sub-objects e.g. myextension.buttons_to_add.play
.description
, a description of the configuration parameterdefault
, a default value used to populate the tag in the configurator UI, if no value is found in config. Note that this is more of a hint to the user than anything functional - since it's only set in the yaml file, the javascript implementing the nbextension in question might actually use a different default, depending on the implementation.input_type
, controls the type of html tag used to render the parameter in the configurator UI. Valid values include text
, textarea
, checkbox
, [html5 input tags such as number
, url
, color
, ...], plus a final type of list
list_element
, a dictionary with the same default
and input_type
keys as a Parameters
entry, used to render each element of the list for parameters with input_type list
min
, step
and max
may be used by number
tags for validationtags
, a list of string tags describing the nbextension, to allow for filteringExample:
Type: Jupyter Notebook Extension
Name: Limit Output
Section: notebook
Description: This nbextension limits the number of characters that can be printed below a codecell
tags:
- usability
- limit
- output
Link: readme.md
Icon: icon.png
Main: main.js
Compatibility: 4.x
Parameters:
- name: limit_output
description: Number of characters to limit output to
input_type: number
default: 10000
step: 1
min: 0
- name: limit_output_message
description: Message to append when output is limited
input_type: text
default: '**OUTPUT MUTED**'
If you encounter problems with this server extension, you can:
For debugging, useful information can (sometimes) be found by:
--debug
flag, to get as many logsas possible.python setup.py
notebook.base.handlers.json_errors
for notebook >= 5.2.0, as it's deprecated.#BEC
) to 6-char, as otherwise theHTML5 controls don't initialize correctly.jupyter_contrib_core
for notebook 5 compatibility.jupyter_contrib_core
in order to ensure setting the correct config key when enabling.nbextensions_path
before checking them, to preventdisplaying duplictae entries for nbextesions in the same place. Also addtests for deduplication./nbextensions
page. Thisallows us to serve the page quicker, then get nbextensions data (slowrequest) from the json api.SingleUserServer
, like#11and#14in futureEnable
jupyterhub
-spawned singleuser notebook serverjupyter_contrib_core
package for notebook compatibility shims and sometesting utilities.jcb91
in favour ofJupyter-contrib
repository versions, where possible.Remove tests dependency on ipython_genutils
First public release!
当我们安装jupyter后,使用jupyter notebook命令启动时,可能会出现下述报错: [W 08:14:31.908 NotebookApp] 加载插件 jupyter_nbextensions_configurator 失败 Traceback (most recent call last): File "e:\virtualenv\one_jupyter-bjs
方法一 step1: jupyter_contrib_nbextensions #用 pip 安装 pip install jupyter_contrib_nbextensions #设置用户 jupyter contrib nbextension install --user step2: jupyter_nbextensions_configurator #用 pip 安装 pip insta
执行 pip install jupyter_contrib_nbextensions jupyter contrib nbextension install --user 报错信息 Could not find a version that satisfies the requirement nbextension (from versions: ) No matching distribu
问题描述 平台:windows 10专业版, anaconda3 在启动jupyter notebook时,有报错信息,如下: ModuleNotFoundError: No module named jupyter_nbextensions_configurator 虽然,jupyter lab 打开还能继续用,但出现报错信息始终是个隐患,于是经过查找资料,找到了以下解决方案 解决办法 py
启动jupyter notebook 时出现: ModuleNotFoundError: No module named ‘jupyter_nbextensions_configurator’ 这种问题比较容易在卸载并安装 Anaconda后轻易出现。 解决方案: 在 Anaconda Prompt 终端执行 python3.7 -m pip install jupyter_contrib_nbe
证明需要在新环境中重新安装一下 jupyter_contrib_nbextensions 插件! 因为一般情况下我们总是打开终端就直接使用pip来安装, 这种情况下就是安装在base的环境下, 而很多情况下我们都是使用的其他虚拟环境,因此需要在这个虚拟环境中重新安装: 附上链接:为Jupyter Notebook安装扩展并启用Configurator 如已经存在,可以先卸载:Jupyter Not
报错笔记 参考自:https://www.cnblogs.com/chouxianyu/p/13867405.html 解决办法: python -m pip install jupyter_nbextensions_configurator