Jupyter_contrib_nbextensions: Snippet extension doesn't reflect the changes in snippets.json

Created on 9 Apr 2018  路  3Comments  路  Source: ipython-contrib/jupyter_contrib_nbextensions

The example snippet works, however, when I changed the example snippet or added another snippet in the snippets.json file,the change is not reflected in the menu bar. I have restarted jupyter notebook and computer and nothing changes.
This is the directory I changed snippets.json.
Thanks!
I changed example to this,but example is still the old example.

{
    "snippets": [
        {
            "name": "example",
            "code": [

                "# /nbextensions/snippets/snippets.json",
                "import this"
            ]
        }
}

screen shot 2018-04-09 at 12 52 27 pm

Most helpful comment

Apologies for the delayed response here. @okdolly, it looks to me like you're editing the file in the python package. This isn't the one that the notebook server uses directly. Instead, all the nbextension files get copied at install time into one of the jupyter data directories. This is done either by the conda recipe, or by the jupyter contrib nbextension install command if you're using pip. So, you need to find the correct file to edit. To find your jupyter data directories, you can try jupyter --paths, or to find which one is in use, you can run the notebook server with the--debug flag to get the nbextensions configurator to log where it looks for (and finds) various nbextensions in the file system. Alternatively, you could maybe re-run the contrib install command to re-copy the files, or (if you're not on Windows, where sumlinks don't work easily) run it using the --symlink flag to make sure the in-use versions are those from the package. Does that make sense?

@dalide, I guess you're probably seeing the same issue, that the file you're editing isn't actually the one that the server is using, but is the python-package copy from which the in-use version gets copied...

All 3 comments

same problem here. I am looking for solutions.

Apologies for the delayed response here. @okdolly, it looks to me like you're editing the file in the python package. This isn't the one that the notebook server uses directly. Instead, all the nbextension files get copied at install time into one of the jupyter data directories. This is done either by the conda recipe, or by the jupyter contrib nbextension install command if you're using pip. So, you need to find the correct file to edit. To find your jupyter data directories, you can try jupyter --paths, or to find which one is in use, you can run the notebook server with the--debug flag to get the nbextensions configurator to log where it looks for (and finds) various nbextensions in the file system. Alternatively, you could maybe re-run the contrib install command to re-copy the files, or (if you're not on Windows, where sumlinks don't work easily) run it using the --symlink flag to make sure the in-use versions are those from the package. Does that make sense?

@dalide, I guess you're probably seeing the same issue, that the file you're editing isn't actually the one that the server is using, but is the python-package copy from which the in-use version gets copied...

@jcb91 thanks for pointing out this. Like you said, it is not under the site-package folder, I found on my computer is the used snippet json file is under Anaconda3/share/jupyter/nbextensions/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rsemenoff picture rsemenoff  路  5Comments

michaelaye picture michaelaye  路  7Comments

BruceChen2017 picture BruceChen2017  路  3Comments

guerreroda picture guerreroda  路  5Comments

gappleto97 picture gappleto97  路  6Comments