Jupyter Notebook,缺少具有nbextensions的工具栏。

huangapple go评论116阅读模式
英文:

Jupyter Notebook, missing toolbar with nbextensions

问题

我正在使用Ubuntu 20.04,并在使用pipenv设置的虚拟环境中工作(Python版本为3.8)。我喜欢使用Jupyter Notebook,并决定安装nbextensions包。安装完成没有错误,我可以通过命令行激活特定扩展,但当我启动Jupyter Notebook时,我没有在启动页面上看到工具栏,可以在其中选择要启用的扩展。

我在这里找到了这个问题:https://stackoverflow.com/questions/49647705/jupyter-nbextensions-does-not-appear 并阅读了其中的内容,但其中的解决方案对我的情况没有帮助。

这是我做的事情:
(在设置了虚拟环境的正常终端中):

$ pipenv install jupyter_contrib_nbextensions
$ pipenv install jupyter-nbextensions-configurator

(这两个命令似乎都成功执行)
然后在激活虚拟环境(pipenv shell)后,我运行了:

$ jupyter contrib nbextension install --user
$ jupyter nbextensions_configurator enable --user

这两个命令似乎也都成功执行。
我能够通过运行jupyter nbextension enable highlight_selected_word/main来启用选定单词的高亮显示。我在笔记本中进行了测试,它正常工作,但很好地拥有工具栏会更好。
我尝试运行jupyter nbextension enable nbextensions_configurator/tree_tab/main,并得到以下输出:

Enabling notebook extension nbextensions_configurator/tree_tab/main...
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

这是jupyter nbextension list的输出(我认为看起来可疑):

已知的nbextensions:
  配置目录: /home/my_user_name/.local/share/virtualenvs/analysis-vLcf5S6s/etc/jupyter/nbconfig
    笔记本部分
      nbextensions_configurator/config_menu/main  已启用
      - 验证: 发现问题:
        - 需要?  X nbextensions_configurator/config_menu/main
      jupyter-js-widgets/extension  已启用
      - 验证: OK
    树部分
      nbextensions_configurator/tree_tab/main  已启用
      - 验证: 发现问题:
        - 需要?  X nbextensions_configurator/tree_tab/main
  配置目录: /home/vasil/.jupyter/nbconfig
    笔记本部分
      nbextensions_configurator/config_menu/main  已启用
      - 验证: 发现问题:
        - 需要?  X nbextensions_configurator/config_menu/main
      contrib_nbextensions_help_item/main  已启用
      - 验证: OK
      varInspector/main  已启用
      - 验证: OK
      highlight_selected_word  已启用
      - 验证: 发现问题:
        - 需要?  X highlight_selected_word
      highlight_selected_word/main  已启用
      - 验证: OK
      nbextensions_configurator/tree_tab/main  已启用
      - 验证: 发现问题:
        - 需要?  X nbextensions_configurator/tree_tab/main
    树部分
      nbextensions_configurator/tree_tab/main  已启用
      - 验证: 发现问题:
        - 需要?  X nbextensions_configurator/tree_tab/main
  配置目录: /usr/local/etc/jupyter/nbconfig
    笔记本部分
      jupyter-js-widgets/extension  已启用
      - 验证: OK

有什么想法吗?

英文:

I'm using Ubuntu 20.04 and working in a virtual environment set up with pipenv. (Python version is 3.8) I like Jupyter Notebook and decided to install the package nbextensions. Installation finished without errors, I can activate a particular extension via the command line, but when I start Jupyter Notebook I don't get a toolbar on the start page where I can just put checks on the extensions that I want to enable.

I found this question posted here: https://stackoverflow.com/questions/49647705/jupyter-nbextensions-does-not-appear and read through it, but the solutions there do not help in my case.

Here is what I did:
(in a normal terminal where I have the virtual environment set up):

$ pipenv install jupyter_contrib_nbextensions
$ pipenv install jupyter-nbextensions-configurator

(both commands seem to be successful)
Then after activation of the virtual environment (pipenv shell) I run

$ jupyter contrib nbextension install --user
$ jupyter nbextensions_configurator enable --user

Those also seem to be successful.
I was able to enable the highlighting of a selected word by running jupyter nbextension enable highlight_selected_word/main. I tested it in a notebook and it works as it should, but it would be good to have the toolbar.
I tried jupyter nbextension enable nbextensions_configurator/tree_tab/main and got the following output:

Enabling notebook extension nbextensions_configurator/tree_tab/main...
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

Here is the output of jupyter nbextension list (that I think looks suspicious):

Known nbextensions:
  config dir: /home/my_user_name/.local/share/virtualenvs/analysis-vLcf5S6s/etc/jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
  config dir: /home/vasil/.jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      contrib_nbextensions_help_item/main  enabled 
      - Validating: OK
      varInspector/main  enabled 
      - Validating: OK
      highlight_selected_word  enabled 
      - Validating: problems found:
        - require?  X highlight_selected_word
      highlight_selected_word/main  enabled 
      - Validating: OK
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main
  config dir: /usr/local/etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension  enabled 
      - Validating: OK

Any ideas?

答案1

得分: 1

我输入了您提供的相同链接,因为我在将Ubuntu 2204用于WSL时遇到了相同的问题。有关降级到版本6.1.5的第二个答案对我有用!

在降级后,再次运行jupyter contrib nbextension install --user,打开jupyter笔记本,搞定了!

英文:

Hey I entered the same link you provided because I was having the same issue using Ubuntu 2204 into WSL. The second answer about downgrading to version 6.1.5 worked for me!

After downgrading ran jupyter contrib nbextension install --user once again, entered jupyter notebook, and done!

huangapple
  • 本文由 发表于 2023年2月26日 23:01:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572854.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定