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

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

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 并阅读了其中的内容,但其中的解决方案对我的情况没有帮助。

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

  1. $ pipenv install jupyter_contrib_nbextensions
  2. $ pipenv install jupyter-nbextensions-configurator

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

  1. $ jupyter contrib nbextension install --user
  2. $ jupyter nbextensions_configurator enable --user

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

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

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

  1. 已知的nbextensions:
  2. 配置目录: /home/my_user_name/.local/share/virtualenvs/analysis-vLcf5S6s/etc/jupyter/nbconfig
  3. 笔记本部分
  4. nbextensions_configurator/config_menu/main 已启用
  5. - 验证: 发现问题:
  6. - 需要? X nbextensions_configurator/config_menu/main
  7. jupyter-js-widgets/extension 已启用
  8. - 验证: OK
  9. 树部分
  10. nbextensions_configurator/tree_tab/main 已启用
  11. - 验证: 发现问题:
  12. - 需要? X nbextensions_configurator/tree_tab/main
  13. 配置目录: /home/vasil/.jupyter/nbconfig
  14. 笔记本部分
  15. nbextensions_configurator/config_menu/main 已启用
  16. - 验证: 发现问题:
  17. - 需要? X nbextensions_configurator/config_menu/main
  18. contrib_nbextensions_help_item/main 已启用
  19. - 验证: OK
  20. varInspector/main 已启用
  21. - 验证: OK
  22. highlight_selected_word 已启用
  23. - 验证: 发现问题:
  24. - 需要? X highlight_selected_word
  25. highlight_selected_word/main 已启用
  26. - 验证: OK
  27. nbextensions_configurator/tree_tab/main 已启用
  28. - 验证: 发现问题:
  29. - 需要? X nbextensions_configurator/tree_tab/main
  30. 树部分
  31. nbextensions_configurator/tree_tab/main 已启用
  32. - 验证: 发现问题:
  33. - 需要? X nbextensions_configurator/tree_tab/main
  34. 配置目录: /usr/local/etc/jupyter/nbconfig
  35. 笔记本部分
  36. jupyter-js-widgets/extension 已启用
  37. - 验证: 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):

  1. $ pipenv install jupyter_contrib_nbextensions
  2. $ pipenv install jupyter-nbextensions-configurator

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

  1. $ jupyter contrib nbextension install --user
  2. $ 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:

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

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

  1. Known nbextensions:
  2. config dir: /home/my_user_name/.local/share/virtualenvs/analysis-vLcf5S6s/etc/jupyter/nbconfig
  3. notebook section
  4. nbextensions_configurator/config_menu/main enabled
  5. - Validating: problems found:
  6. - require? X nbextensions_configurator/config_menu/main
  7. jupyter-js-widgets/extension enabled
  8. - Validating: OK
  9. tree section
  10. nbextensions_configurator/tree_tab/main enabled
  11. - Validating: problems found:
  12. - require? X nbextensions_configurator/tree_tab/main
  13. config dir: /home/vasil/.jupyter/nbconfig
  14. notebook section
  15. nbextensions_configurator/config_menu/main enabled
  16. - Validating: problems found:
  17. - require? X nbextensions_configurator/config_menu/main
  18. contrib_nbextensions_help_item/main enabled
  19. - Validating: OK
  20. varInspector/main enabled
  21. - Validating: OK
  22. highlight_selected_word enabled
  23. - Validating: problems found:
  24. - require? X highlight_selected_word
  25. highlight_selected_word/main enabled
  26. - Validating: OK
  27. nbextensions_configurator/tree_tab/main enabled
  28. - Validating: problems found:
  29. - require? X nbextensions_configurator/tree_tab/main
  30. tree section
  31. nbextensions_configurator/tree_tab/main enabled
  32. - Validating: problems found:
  33. - require? X nbextensions_configurator/tree_tab/main
  34. config dir: /usr/local/etc/jupyter/nbconfig
  35. notebook section
  36. jupyter-js-widgets/extension enabled
  37. - 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:

确定