简体   繁体   English

Jupyter nbextensions 没有出现

[英]Jupyter nbextensions does not appear

I tried to install jupyter_contrib_nbextensions: http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html我尝试安装 jupyter_contrib_nbextensions: http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html

Everything worked fine but when I open a notebook nothing changes.一切正常,但当我打开笔记本时,没有任何变化。 I can't see the new tool bar that I'm supposed to see.我看不到应该看到的新工具栏。

When I reinstall the Extension, the process is the same (I don't have a message tellign me that the files already exists).当我重新安装扩展时,过程是相同的(我没有消息告诉我文件已经存在)。 I don't have an error.我没有错误。 So I can't figure out why it doesn't work.所以我不明白为什么它不起作用。

Thanks a lot.非常感谢。

Follow 3 steps: In Terminal遵循 3 个步骤:在终端中

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable varInspector/main

after this you will see "Vaildating: ok" Now you can open jupyter notebook you will see the require changes在此之后,您将看到“验证:确定”现在您可以打开 jupyter notebook,您将看到需要的更改

Update Jan 2021 2021 年 1 月更新
I was seeing this issue using the latest from pip packages.我使用 pip 包中的最新版本看到了这个问题。

Turns out it was related to: https://discourse.jupyter.org/t/the-static-notebook-js-mathjaxutils-js-is-missing/7303原来它与以下内容有关: https : //discourse.jupyter.org/t/the-static-notebook-js-mathjaxutils-js-is-missing/7303

Basically, jupyter-notebook moved a .js file in a recent update causing the extensions tab to no longer appear.基本上,jupyter-notebook 在最近的更新中移动了一个 .js 文件,导致扩展选项卡不再出现。

Reverting to an older version works-around the issue:恢复到旧版本可以解决这个问题:

pip install notebook==6.1.5

Also note that a substantial number of the extensions aren't officially supported by the 6.x version.另请注意,6.x 版本并未正式支持大量扩展。 So you may be better off reverting to 5.x until your desired extensions are 'officially' supported:因此,在“正式”支持所需的扩展之前,最好恢复到 5.x:

pip install notebook==5.7.10

First, follow this SO-post (go to the update) to install the extension.首先,按照此SO-post (转到更新)安装扩展。 Then shutdown the notebook server.然后关闭笔记本服务器。 Then type $ jupyter nbextension enable varInspector/main .然后输入$ jupyter nbextension enable varInspector/main If it says OK , you can start your notebook and should see the crosshair.如果它显示OK ,您可以启动您的笔记本并应该看到十字准线。

Try this out ->试试这个->

1)Open Anaconda Prompt. 1) 打开 Anaconda 提示。

2)Type in - 2)输入 -

conda install -c conda-forge jupyter_contrib_nbextensions

(if c is the default directory) (如果 c 是默认目录)

3)Proceed with the installation. 3) 继续安装。

4)Exit the Anacodna prompt. 4)退出Anacodna提示。

5)Relaunch Jupyter notebook. 5) 重新启动 Jupyter 笔记本。 (You will now see nbextensions tab) (您现在将看到 nbextensions 选项卡)

Following are the commands which installs the jupyter nb_extensions以下是安装 jupyter nb_extensions 的命令

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

The second command might give you below error:第二个命令可能会给你以下错误:

jupyter contrib not found

Above command can be resolved as below:上面的命令可以解析如下:

- open cmd to install manually
cd .\Python\<your-python-version>\Lib\site-packages\jupyter_contrib_nbextensions
python application.py install
- Restart the jupyter notebook server

Note : Also make sure that your packages jupyter , notebook and your jupyter_contrib_nbextensions are installed for same version of python (and same --user if you have installed all your packages with --user flag)注意:还要确保您的软件包jupyternotebook和您的jupyter_contrib_nbextensions是为相同版本的 python 安装的(如果您已使用--user标志安装了所有软件包,则安装相同的--user

Following steps with Anaconda Prompt ->按照 Anaconda 提示的步骤 ->

1)Open Anaconda Prompt. 1)打开Anaconda提示符。

2)Type in - 2) 输入 -

conda install -c conda-forge jupyter_contrib_nbextensions

  1. Enter 'y' for installation.输入“y”进行安装。

  2. type in jupyter contrib nbextension install --sys-prefix输入jupyter contrib nbextension install --sys-prefix

4)Exit the Anacodna prompt. 4) 退出 Anacodna 提示符。

5)Relaunch Jupyter notebook. 5) 重新启动 Jupyter notebook。 (You will now see nbextensions tab) (您现在将看到 nbextensions 选项卡)

  1. Screenshot of my installation我的安装截图

try to run this尝试运行这个

jupyter contrib nbextension install --user

then relaunch the Jupyter notebook.然后重新启动 Jupyter 笔记本。 this might solve the problem as it did for me.这可能会像对我一样解决问题。

Running following command one by one !!!一一运行以下命令!!!

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main
jupyter nbextension enable codefolding/main

1 quick info - 1 快速信息 -
1. even after enabling nbextensions, from the notebooks tree page, 1. 即使在启用 nbextensions 之后,从 notebooks 树页面,
2. you need to activate it on your Jupyter notebook. 2. 你需要在你的 Jupyter notebook 上激活它。 See below.见下文。 在此处输入图片说明

在此处输入图片说明

Posting this solution because it took me 20 minutes to figure out why my interface looked so different from all of the screenshots everyone else was posting.发布此解决方案是因为我花了 20 分钟才弄清楚为什么我的界面看起来与其他人发布的所有屏幕截图如此不同。 I hope it can prevent some other soul from making the same mistake I did:我希望它可以防止其他人犯我犯过的错误:

I was running my Jupyter Notebook with the command jupyter-lab instead of jupyter notebook .我使用命令jupyter-lab而不是jupyter notebook运行我的 Jupyter Notebook。 I understand there are functional differences between the two, but in my case having spellcheck was much more important than any of the difference the two provided.我知道两者之间存在功能差异,但在我的情况下,拼写检查比两者提供的任何差异都重要得多。 As soon as I used jupyter notebook instead, it worked perfectly.我一改用jupyter notebook ,它就完美地工作了。

Downgrading the notebook version to 5.6.0 worked for me.将笔记本版本降级到 5.6.0 对我有用。

pip install notebook==5.6.0

If this doesn't work for you, then return to your original version.如果这对您不起作用,请返回到您的原始版本。

Good luck.祝你好运。

I followed the highest voted answer to install the nbextensions but received an error when I reboot the Jupyter Notebook:我按照投票最高的答案安装了 nbextensions,但在我重新启动 Jupyter Notebook 时收到错误消息:

404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20220513151408 404获取/nbextensions/nbextensions_configurator/tree_tab/main.js?v=20220513151408

It seemed that what I've installed can not be found by Jupyter Notebook. Jupyter Notebook 似乎无法找到我安装的内容。

After checking the detailed installation log in the terminal, I found Nbextension has been installed into the python2.7 directory:在终端查看详细的安装日志,发现Nbextension已经安装到python2.7目录下:

./Library/Python/2.7/lib/python/site-packages (from jupyter_contrib_nbextensions) ./Library/Python/2.7/lib/python/site-packages(来自 jupyter_contrib_nbextensions)

I am currently using Python 3 in Jupyter Notebook so I decided to uninstall what I have and reinstall Nbextension using pip3 instead of pip. Then I reboot Jupyter Notebook and saw the Nbextensions tab (next to the tab Clusters)!我目前在 Jupyter Notebook 中使用 Python 3,所以我决定卸载我拥有的东西并使用 pip3 而不是 pip 重新安装 Nbextension。然后我重新启动 Jupyter Notebook 并看到 Nbextensions 选项卡(在选项卡 Clusters 旁边)!

In sum, based on my attempt, I would recommend using pip3 instead of pip to avoid an installation in Python 2 directory.总之,根据我的尝试,我建议使用 pip3 而不是 pip 以避免安装在 Python 2 目录中。

Change old path notebook/js/mathjaxutils to base/js/mathjaxutils.js to load the dependency correctly.将旧路径notebook/js/mathjaxutilsbase/js/mathjaxutils.js以正确加载依赖项。

在此处输入图片说明

This solve my problem.这解决了我的问题。

For details see this Github issue about this bug.有关详细信息,请参阅有关此错误的 Github 问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM