1

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

Krazy_JT
  • 11
  • 1
  • Welcome ! Did you go to `C:\ProgramData\jupyter\nbextensions\snippets` and change the `snippets.json` file and save it? – Talha Tayyab Mar 07 '23 at 06:06
  • Hello thanks for checking! Since im using mac, i have changed the snippets.json file directly from the "Include custom menu content parsed from JSON string below" option. In this case do i still need to change the json file? – Krazy_JT Mar 07 '23 at 06:23
  • I am not sure about Mac, generally we change json in Windows. – Talha Tayyab Mar 07 '23 at 06:24
  • oh sorry for my confusion, I am talking about "Snippets Menu" instead of "Snippets". Is it still the same case? Coz i saw online once the extension is enabled, they would automatically appear after i refreshed the notebook – Krazy_JT Mar 07 '23 at 06:30
  • check this out https://stackoverflow.com/questions/55261170/how-to-add-edit-code-snippets-in-jupyer-notebook – Talha Tayyab Mar 07 '23 at 06:31
  • thank you for your help! I followed the ins inside but it still doesn't work for me – Krazy_JT Mar 07 '23 at 06:42

1 Answers1

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.

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.

Captain Morgan
  • 233
  • 1
  • 9