Jupyter Notebook 扩展:启用 nbextensions 后,快捷菜单无法正常工作。

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

Jupyter Notebook Extension: Snippets menu is not working after enabling nbextensions

问题

我已安装nbextensions后,启用了一些扩展,如Hinterland、Snippets和Snippets Menu。其他扩展都运行得很正常,除了Snippets Menu。

我不确定为什么片段菜单选项卡没有显示,理应我应该能够从下拉菜单中访问numpy等的片段代码。

我尝试了多种方法,如重新安装nbextensions、刷新会话、重新启动服务器,但都没有用。

理想情况下,它应该显示为类似于这样的东西:Snippets Menu

英文:

After I have installed nbextensions, I have enabled a few extensions such as Hinterland, Snippets, and Snippets Menu. The other extensions are working pretty fine, except for Snippets Menu.

I am not sure why the snippet menu tab is not showing, in which supposingly I should be able access the snippet codes of numpy etc from its drop-down menu.

I have tried multiple methods like reinstall nbextensions, refreshing my session, restarting the server, but noun of them work.Current view

Ideally it should appear as sth like this
Snippets Menu

答案1

得分: 1

I'm not exactly sure if the problem you're having stems from the same I had earlier, but this might help.

我不确定你遇到的问题是否与我之前遇到的问题有关,但这可能会有所帮助。

I had everything up and running perfectly. I wiped and reinstalled Python to go to 3.10 for no real reason. Snippets_menu no longer showed. Not sure if other extensions flopped as a result. Dug around for hours trying to resolve or find a path to go down to no avail. Inspected notebook page in chrome. The point of the last blurb is to help others with similar issues know where to start looking.

我之前一切都正常运行。我不知为何擦除并重新安装了Python以升级到3.10。Snippets_menu不再显示。不确定是否因此导致其他扩展失败。花了数小时挖掘,试图解决问题或找到可行的解决方案,但一无所获。在Chrome中检查笔记本页面。最后一段的目的是帮助其他遇到类似问题的人知道从何开始查找。

SOLUTION:

解决方法

snippets_menu seems to not load because there's an issue with the pandas sub_menu, thus breaking the whole thing. Go to, \AppData\Roaming\jupyter\nbextensions\snippets_menu\snippets_submenus_python\pandas.js, and enclose the stuff with single quotes (label_count, label, label_mean) to either double quotes or \' instead of singles.

snippets_menu似乎无法加载,因为与pandas子菜单存在问题,从而破坏了整个系统。前往\AppData\Roaming\jupyter\nbextensions\snippets_menu\snippets_submenus_python\pandas.js,将内容用双引号(label_countlabellabel_mean)括起来,而不是使用单引号。

To open the AppData directory, I usually enter %appdata% into the start menu. I.e. press Win key -> type %appdata% -> hit Enter key.

要打开AppData目录,通常我会在开始菜单中输入%appdata%。即按Win键 -> 输入%appdata% -> 按回车键。

Everything here was in Windows context. Sorry Mac & Unix users. Maybe a comment from someone can add to this.

这里的一切都是在Windows环境下。对不起,Mac和Unix用户。也许其他人的评论可以补充说明。

英文:

I'm not exactly sure if the problem you're having stems from the same I had earlier, but this might help.

I had everything up and running perfectly. I wiped and reinstalled Python to go to 3.10 for no real reason. Snippets_menu no longer showed. Not sure if other extensions flopped as a result. Dug around for hours trying to resolve or find a path to go down to no avail. Inspected notebook page in chrome. The point of the last blurb is to help others with similar issues know where to start looking.

SOLUTION:

snippets_menu seems to not load because there's an issue with the pandas sub_menu, thus breaking the whole thing. Go to, \AppData\Roaming\jupyter\nbextensions\snippets_menu\snippets_submenus_python\pandas.js, and enclose the stuff with single quotes (label_count, label, label_mean) to either double quotes or \' instead of singles.

To open the AppData directory, I usually enter %appdata% into the start menu. I.e. press Win key -> type %appdata% -> hit Enter key.

Everything here was in Windows context. Sorry Mac & Unix users. Maybe a comment from someone can add to this.

huangapple
  • 本文由 发表于 2023年3月7日 14:01:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75658498.html
匿名

发表评论

匿名网友

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

确定