-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 error for /nbextensions/config/main.js #489
Comments
Hmm, that's strange. It seems from the log like you're missing the main.js file, although the server-side part of the extension seems to (maybe?) be working (giving you the source you can view, and the |
Could you post the output of import os.path
from jupyter_core.paths import jupyter_path
def find_extension(ext_path):
for base in jupyter_path():
curr_path = os.path.join(base, 'nbextensions', ext_path)
if os.path.exists(curr_path):
print('found extension at {!r}'.format(curr_path))
find_extension('config/main.js') |
The results of I'm not sure whether this is something I might have done during the installation (I don't think so). Maybe there's a typo somewhere in the setup script? If I recall correctly, I did get an error message during the installation that required me do |
Ok, glad you've got it working for you, at least! Looking at https://github.com/ipython-contrib/IPython-notebook-extensions/blob/master/install.py#L46-L56 it seems that the script will install to |
yes, that definitely explains it! Of course, this shouldn't happen, as you point out in #492 |
Hello @goerz and @jcb91, would welcome your help if you can provide it. I'm getting this same error Symptoms of my problem:
I placed my log file from launching jupyter notebook with debug here Here is my output of >>> from jupyter_core.paths import jupyter_path
>>> print(jupyter_path())
['/Users/linwood/Library/Jupyter', '/Users/linwood/anaconda3/share/jupyter', '/usr/local/share/jupyter', '/usr/share/jupyter'] If this helps, here's the jupyter I'm using when I'm not in an environment: >>> which jupyter
/Users/linwood/anaconda3/bin/jupyter |
It might just be a permissions problem. Try removing all of your jupyter configuration directories and start from scratch. It might be better to post this type of question to Stackoverflow to figure out what's going on. |
@goerz , I posted it here as instructed. http://stackoverflow.com/questions/41627159/how-do-i-get-rid-of-python-jupyter-notebook-error-404-get-nbextensions-nbexten |
Hi @linwoodc3, thanks for the detailed diagnostics! The install machanism for the configurator has changed somewhat since @goerz's initial issue here, and I can't say I'm immediately sure what the problem is, but I'll offer the thoughts which occur to me at the moment.
So, all of the above, particularly numbers 3 & 4 in that list, implies to me that somehow the config file(s) which should tell the notebook server to load its serverextensions haven't got edited correctly. For conda-packaged extensions, they should be editing the sys-prefix config file, which for your current env is {
"version": 1,
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_conda": true,
"nb_anacondacloud": true,
"jupyter_nbextensions_configurator": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} (possibly with extra items, but I'd expect to see at least these). As to why this has happened, I'm not sure, but suspect it may be related to #828, where we're seeing the post-link script (which do the config file editing) failing for reasons which so far escape me. It's interesting to note that it seems to have affected nb_conda serevrrextensions as well as ones I've packaged, though. As a one-time fix, you should (hopefully) be able to use (from command line with correct conda env active)
though of course this won't prevent it happening again in new environments, so it's only a band-aid for now. Let me know whether any of that makes sense/helps 😄 |
From the last picture in the stackoverflow post, on the right on the toolbar, it seems that some nbextensions are loaded (nbpresent?, code_prettify?). Is that right? Could you post the javascript console log here, in order to see if the nbextensions are requested (and which) and if some are loaded? |
Thanks for responding @jfbercher . As a note, I did this before I ran the fix from @jcb91. I apologize if this is the wrong thing, but I used the "Developer Tools" console of the Chrome browser to record the javascript activity as the page reloaded. Here is the info (picture of errors below too): 2. Network(X) Basics (Student).ipynb:119 loaded custom.js
default.js:48 Default extension for cell metadata editing loaded.
rawcell.js:82 Raw Cell Format toolbar preset loaded.
slideshow.js:43 Slideshow extension for metadata editing loaded.
menubar.js:240 actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later...
MenuBar.bind_events @ menubar.js:240
MenuBar @ menubar.js:55
(anonymous) @ main.js:102
execCb @ require.js?v=6da8be3…:1690
check @ require.js?v=6da8be3…:865
(anonymous) @ require.js?v=6da8be3…:1140
(anonymous) @ require.js?v=6da8be3…:131
(anonymous) @ require.js?v=6da8be3…:1190
each @ require.js?v=6da8be3…:56
emit @ require.js?v=6da8be3…:1189
check @ require.js?v=6da8be3…:940
(anonymous) @ require.js?v=6da8be3…:1140
(anonymous) @ require.js?v=6da8be3…:131
(anonymous) @ require.js?v=6da8be3…:1190
each @ require.js?v=6da8be3…:56
emit @ require.js?v=6da8be3…:1189
check @ require.js?v=6da8be3…:940
enable @ require.js?v=6da8be3…:1177
init @ require.js?v=6da8be3…:783
callGetModule @ require.js?v=6da8be3…:1204
completeLoad @ require.js?v=6da8be3…:1604
onScriptLoad @ require.js?v=6da8be3…:1711
utils.js:59 load_extensions ["nbpresent/js/nbpresent.min", "nb_conda/main", "nb_anacondacloud/main", "jupyter-js-widgets/extension"]
utils.js:36 Loading extension: nbpresent/js/nbpresent.min
utils.js:36 Loading extension: nb_anacondacloud/main
require.js?v=6da8be3…:1952 GET http://localhost:8888/nbextensions/nbpresent/js/nbpresent.deps.min.js.js
req.load @ require.js?v=6da8be3…:1952
load @ require.js?v=6da8be3…:1679
load @ require.js?v=6da8be3…:829
fetch @ require.js?v=6da8be3…:819
check @ require.js?v=6da8be3…:851
enable @ require.js?v=6da8be3…:1177
enable @ require.js?v=6da8be3…:1550
(anonymous) @ require.js?v=6da8be3…:1162
(anonymous) @ require.js?v=6da8be3…:131
each @ require.js?v=6da8be3…:56
enable @ require.js?v=6da8be3…:1114
init @ require.js?v=6da8be3…:783
(anonymous) @ require.js?v=6da8be3…:1453
require.js?v=6da8be3…:165 Uncaught Error: Script error for "nbpresent-deps"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js?v=6da8be3…:165)
at HTMLScriptElement.onScriptError (require.js?v=6da8be3…:1732)
makeError @ require.js?v=6da8be3…:165
onScriptError @ require.js?v=6da8be3…:1732
session.js:54 Session: kernel_created (ac540fe3-f39d-4a3d-80c5-265638fb8811)
kernel.js:453 Starting WebSockets: ws://localhost:8888/api/kernels/445b6828-66f3-4312-a79f-3c4473345579
kernel.js:100 Kernel: kernel_connected (445b6828-66f3-4312-a79f-3c4473345579)
kernel.js:100 Kernel: kernel_ready (445b6828-66f3-4312-a79f-3c4473345579)
utils.js:36 Loading extension: nb_conda/main
utils.js:36 Loading extension: jupyter-js-widgets/extension
extension.js:88 loaded widgets
manager-base.js:195 Widget backend and frontend versions are compatible
|
@jcb91; thanks for the response! About to try your fix; first I looked for all possible files matching that name: sudo find / -type f -name "jupyter_notebook_config.json" and found these files: /Users/linwood/.anaconda_backup/.jupyter/jupyter_notebook_config.json
/Users/linwood/anaconda3/envs/analysis/etc/jupyter/jupyter_notebook_config.json
/Users/linwood/anaconda3/envs/scipyML/etc/jupyter/jupyter_notebook_config.json
/Users/linwood/anaconda3/etc/jupyter/jupyter_notebook_config.json
/Users/linwood/anaconda3/pkgs/_nb_ext_conf-0.3.0-py27_0/etc/jupyter/jupyter_notebook_config.json
/Users/linwood/anaconda3/pkgs/_nb_ext_conf-0.3.0-py35_0/etc/jupyter/jupyter_notebook_config.json Here is what each file had in it: {
"NotebookApp": {
"nbserver_extensions": {
"jupyter_nbextensions_configurator": true
}
}
} /Users/linwood/anaconda3/envs/analysis/etc/jupyter/jupyter_notebook_config.json {
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_conda": true,
"nb_anacondacloud": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} /Users/linwood/anaconda3/envs/scipyML/etc/jupyter/jupyter_notebook_config.json {
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_anacondacloud": true,
"nb_conda": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} /Users/linwood/anaconda3/etc/jupyter/jupyter_notebook_config.json {
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_anacondacloud": true,
"nb_conda": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} /Users/linwood/anaconda3/pkgs/_nb_ext_conf-0.3.0-py27_0/etc/jupyter/jupyter_notebook_config.json {
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_conda": true,
"nb_anacondacloud": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} /Users/linwood/anaconda3/pkgs/_nb_ext_conf-0.3.0-py35_0/etc/jupyter/jupyter_notebook_config.json {
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_anacondacloud": true,
"nb_conda": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
} |
When I tried to run your script in my base anaconda environment, I got this: Enabling: jupyter_nbextensions_configurator
- Writing config: /Users/linwood/anaconda3/etc/jupyter
- Validating...
Error loading server extension jupyter_nbextensions_configurator
X is jupyter_nbextensions_configurator importable?
Enabling: nb_conda
- Writing config: /Users/linwood/anaconda3/etc/jupyter
- Validating...
Error loading server extension nb_conda
X is nb_conda importable?
Enabling: nb_anacondacloud
- Writing config: /Users/linwood/anaconda3/etc/jupyter
- Validating...
Error loading server extension nb_anacondacloud
X is nb_anacondacloud importable?
Enabling: nbpresent
- Writing config: /Users/linwood/anaconda3/etc/jupyter
- Validating...
Error loading server extension nbpresent
X is nbpresent importable? In my scipyML I got this: Enabling: jupyter_nbextensions_configurator
- Writing config: /Users/linwood/anaconda3/envs/scipyML/etc/jupyter
- Validating...
jupyter_nbextensions_configurator OK
Enabling: nb_conda
- Writing config: /Users/linwood/anaconda3/envs/scipyML/etc/jupyter
- Validating...
nb_conda OK
Enabling: nb_anacondacloud
- Writing config: /Users/linwood/anaconda3/envs/scipyML/etc/jupyter
- Validating...
nb_anacondacloud OK
Enabling: nbpresent
- Writing config: /Users/linwood/anaconda3/envs/scipyML/etc/jupyter
- Validating...
nbpresent OK And still getting this: 404 GET /nbextensions/nbpresent/js/nbpresent.deps.min.js.js (::1) 47.11ms referer=http://localhost:8888/notebooks/tutorials/stanfordCoreNLPnPython.ipynb |
Ok, so from the contents of your various config files @linwoodc3, it looks like for one reason or another the jupyter_nbextensions_configurator post-link script has made changes which have made it into the When you mention
did that fix the configurator (for a notebook server run from environment)? To diagnose why this (no enable of serverextension) has happened in the first place, I recommend in each environment trying conda uninstall --force jupyter_nbextensions_configurator
conda install -c conda-forge jupyter_nbextensions_configurator (the cat "$CONDA_PREFIX/.messages.txt" Alternatively, to skip diagnosis & just get configurator working, you should be able to run jupyter nbextensions_configurator enable --sys-prefix in each environment (this is what the post-link script is supposed to do).
Yeah, that bit, I'm not sure about, it looks like an error with the nbpresent conda package, which I'm not conda uninstall --force nbpresent
conda install nbpresent |
Clearly, from the JS console output, we see that there is an error when loading nbpresent. |
I treid everything above; sadly, still not getting the nbextensions on the top of my notebook. Made another log here https://gist.github.com/linwoodc3/a41f9e7a83c75a1d858b71d9ca13c8b2. Is there a way for me to start over completely? Delete everything? |
From lines 16-20 in your new log, it looks like the configurator is loading correctly.
I'm not exactly sure what you're expecting to see here? It certainly seems that at least some are loading correctly (as @jfbercher noted above, it looks like at least
That's certainly the most definite way of resolving the problem - delete the entire conda env (note that uninstalling the packages may not be sufficient to restore the jupyter config/data directories), then recreate it from scratch. Of course, that may not be very desirable, in which case you could try the slightly less scorched-earth approach of deleting the jupyter data & config directories, then uninstalling notebook (which will remove its dependencies also), and then reinstall it. E.g. from the environment in question, something along the lines of rm -r "$CONDA_PREFIX/etc/jupyter" # remove sys-prefix config dir
rm -r "$CONDA_PREFIX/share/jupyter" # remove sys-prefix data dir
conda uninstall jupyter_contrib_nbextensions jupyter_nbextensions_configurator nbpresent nb_conda nb_conda_kernels nb_anacondacloud
conda install jupyter_contrib_nbextensions jupyter_nbextensions_configurator nbpresent nb_conda nb_conda_kernels nb_anacondacloud |
My apologies @jcb91 . I really appreciate you guys doing this and helping; know it's not payment involved. Love open source and made one module myself so understand. On to the issue: In regards to this:
I am trying to get the nbpresent button to appear in the top right corner of my normal notebook view (where I write code and do stuff), so I can hit the "play" button and edit/create a presentation. I know how to do the RISE js button, but want the nbpresent button. Right now, all I see is the anaconda cloud button. I deleted my entire Anaconda install, reinstalled, and also made sure these directories didn't exist: rm -r "$CONDA_PREFIX/etc/jupyter" # remove sys-prefix config dir
rm -r "$CONDA_PREFIX/share/jupyter" # remove sys-prefix data dir Then I ran this (note I had to add conda install -c conda-forge jupyter_contrib_nbextensions jupyter_nbextensions_configurator nbpresent nb_conda nb_conda_kernels nb_anacondacloud Then, I started following instructions on the installing jupyter_contrib_nb_extensions page. Did this next: jupyter contrib nbextension install --user The output from that command is here Then, the first time I ran Now I see a new configuring tab (friggin awesome!!! never saw that before...is this config added to the default conda channel??? some employers might mirror the free conda..so if it is, it's there). But, notice the blacked out extensions (the one I want the most..sheesh). When I hover over them, it says " possibly incompatible" The good news is, that when I launch my notebooks, now, I see the buttons for the enabled extensions. THe last piece, is getting this nbpresent button to work. Here is the highlighter working! I think we're almost there, but understand if you're pooped out. Any suggestions appreciated. Also hope this discussion helps someone else if they run into the problem. Trying to document every step. |
So, it almost work now. Nice. As far as |
No need, happy to help - seeing people use things you've contributed to is a reward in itself, after all 😄
Ok, since you're using the conda packages, this wasn't actually necessary (the conda package does this step as part of its post-link script, using the
The configuring tab is provided by the jupyter_nbextensions_configurator serverextension, which gets installed as a dependency of this repo. Glad you like it 😄. I'm not sure what you mean by config being added to the default conda channel? The configurator edits jupyter config files using the notebook server's config API in order to control which nbextensions get loaded, and set options for them. I'm also not sure what you mean about employers mirroring the free conda?
As @jfbercher mentions, this is just because these are nbextensions provided not by this repo, but by some other party (e.g., as mentioned, the various |
Maybe we could talk to the Anaconda people to include a yaml file for their extensions. @damianavila what do you think ? |
This is a fantastic idea. The extensions that are greyed out, are the ones that are apparently officially supported (and socialized) by Continuum: https://docs.continuum.io/anaconda/jupyter-notebook-extensions And regarding this:
I mean have your configurator included in the repos here: https://repo.continuum.io/pkgs/ If you can make it so you can install the configurator without having to use the forge channel only, that would be ideal! But, of course, this is just one person's idea (me). Even so, it would open up the user base. I now understand I mistakenly thought you all were tied to the nbextensions mentioned on this page: https://docs.continuum.io/anaconda/jupyter-notebook-extensions. However, like @juhasch says, it seems like it's a natural marriage. |
@juhasch we might as well ask, certainly!
Ah, I see! Yes, there's quite a lot of confusion generally about nbextensions, who provides them, and what counts as 'official' in various contexts. Largely because it's pretty varied, complex & potentially confusing, with not that many docs available, I suppose!
Thanks for that link, I learn from there that it's the conda package
|
It is a good idea, I think... can you open an issue in some of the repos so we don't forget about that? Thanks! |
I experienced the same issue immediately after installing Jupyter_contrib_nbextensions. |
In my case, it was the corporate proxy that was blocking connection to the notebook kernel (I was still able to browse the directory tree). The issue was resolved after adding the IP address of the local Jupyte server to the exception list of proxy. |
After following the install instructions in the README (git clone + setup.py install), I get a 404 error when going to /nbextensions on the notebook server
The log file from starting the notebook server as above and navigating to http://localhost:47962/nbextensions is at log.txt
The browser is showing a blank page (however, when showing the page source, there's some code there that looks like what I would expect)
The text was updated successfully, but these errors were encountered: