Open nick-youngblut opened 6 years ago
My "Nbextensions configuration" looks like the following:
For all of the extensions, I get the following: ...but doesn't provide a yaml file to tell us how to configure it
However, the *.yaml files seem to be present:
data_analysis_workshops/anaconda3/pkgs/jupyter_contrib_nbextensions-0.3.1-py36_0/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/python-markdown/python-markdown.yaml
data_analysis_workshops/anaconda3/pkgs/jupyter_contrib_nbextensions-0.3.1-py36_0/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/codefolding/codefolding.yaml
data_analysis_workshops/anaconda3/pkgs/jupyter_contrib_nbextensions-0.3.1-py36_0/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/codefolding/codefolding_editor.yaml
data_analysis_workshops/anaconda3/pkgs/jupyter_contrib_nbextensions-0.3.1-py36_0/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/runtools/runtools.yaml
data_analysis_workshops/anaconda3/pkgs/jupyter_contrib_nbextensions-0.3.1-py36_0/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/scroll_down/config.yaml
... [a total of 58 *.yaml files in this directory]
I have other jupyter notebooks running but they are in different conda environments in different anaconda installs at various locations on the server. Why is
jupyter_contrib_nbextensions
assessing jupyter notebooks in other isolated conda environments? Do I have to shut down all notebooks in order to installjupyter_contrib_nbextensions
?
So the install command uses the notebook.notebookapp.list_running_servers
function. Although this allows you to specify a runtime directory in which to check for servers, the default jupyter runtime directory is set system-wide, so there isn't really a reliable way to distinguish between environments. Personally, I don't think installing while notebook servers are running is a problem at all, excepting the rare case where a config file gets edited while the notebook server is reading it, which I think is probably rare enough to consider acceptable. Certainly other extensions like nb_conda_kernels
and nb_anacondacloud
don't bother with this check.
Anyway, since it's part of the post-link step in the conda install, the python package gets installed ok (as you have observed, all the yaml files are present in the python package's nbextensions
directory), and you can manually run the second step of the install ignoring running servers, using
jupyter contrib nbextensions install --sys-prefix --skip-running-check
from the appropriate conda environment.
To clarify, the reason all the yaml files are present, but not found by the notebook server, is that the notebook server looks for nbextensions in the jupyter path, but the yaml files you've found are part of the python package (for distribution) and haven't been correctly copied into any of the jupyter data directories.
I hope some of that makes sense - let me know if not.
Any thoughts on removing/making non-default the running check @nick-youngblut, @jfbercher @juhasch?
Thanks for the clarification! I tried jupyter contrib nbextensions install --sys-prefix --skip-running-check
and just got the following:
community-contributed spice for Jupyter Interactive Computing
Options
-------
Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.
--debug
set log level to logging.DEBUG (maximize logging output)
--generate-config
generate default config file
-y
Answer yes to any questions instead of prompting.
--log-level=<Enum> (Application.log_level)
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--config=<Unicode> (JupyterApp.config_file)
Default: ''
Full path of a config file.
To see all available configurables, use `--help-all`
[JupyterContribApp] CRITICAL | Bad config encountered during initialization:
[JupyterContribApp] CRITICAL | Unrecognized flag: '--sys-prefix'
I'm guessing that I should be using different options rather than: --sys-prefix
and --skip-running-check
.
blegh, try
jupyter contrib nbextension
without the s
? Or possibly even
jupyter-contrib-nbextension
jupyter-contrib -h
and jupyter-contrib nbextension -h
produce the same output on options:
community-contributed spice for Jupyter Interactive Computing
Options
-------
Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.
--debug
set log level to logging.DEBUG (maximize logging output)
--generate-config
generate default config file
-y
Answer yes to any questions instead of prompting.
--log-level=<Enum> (Application.log_level)
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--config=<Unicode> (JupyterApp.config_file)
Default: ''
Full path of a config file.
To see all available configurables, use `--help-all'`
I'm not see where --sys-prefix
or --skip-running
come in to play.
Yeah, the help message is for the jupyter-contrib script, which should find the nbextension subcommand (which accepts the flags) from pkg_resources. Perhaps the subcommand script hasn't been installed correctly 🤔
You could alternatively do this in python, I guess:
from jupyter_contrib_nbextensions.install import toggle_install
toggle_install(True, sys_prefix=True, skip_running_check=True)
jupyter-contrib-nbextension install --help-all
or jupyter contrib nbextension install --help-all
will give you the options. Alternatively just --help
will do.
Yeah, conda install -c conda-forge jupyter_contrib_nbextensions
failed due to the error: Cannot configure while the Jupyter notebook server is running
, which is probably why the nbextensions
subcommand is not found.
jupyter-contrib-nbextension
isn't installed due to the failed install (the error: Cannot configure while the Jupyter notebook server is running
).
Weird, that script should get copied as part of the python package install (which seems to have happened ok), before the post-link script (which is what fails). Oh well, it's not super important, as it doesn't do much beyond install/uninstall. Given all these complications, you may be better off following the pip package installation instructions from scratch, using the --sys-prefix
and --skip-running-check
flags...
OK, the following worked:
pip install jupyter_contrib_nbextensions
jupyter contrib nbextensions install --sys-prefix --skip-running-check
Thanks for your help!
I had this same issue even though I had closed all my my notebooks and restarted my computer. The final comment worked for me!
I had this issue too and like @lportelli4 I closed all my notebooks and restarted the pc. The final comment (by @nick-youngblut ) solved it!
Hmm, it seems like the notebook code for detecting running servers is throwing up false positives then 🤔😞
This is being discussed in https://github.com/jupyter/notebook/issues/2829
I guess we should add the --skip-running-check
flag to the troubleshooting documentation.
See PR #1100
I restarted my macbook and the last comment contributed by@nick-youngblut worked. My problem was I have both py2 and py3 environment, and my jupyter notebook is running on py3 while i try to install the nbextension on py2 environment. That's why i failed.
I have problem on the second command jupyter_contrib_nbextensions
when use pip : pip install jupyter_contrib_nbextensions
and I try to use conda:
the same result :
and I use jupyter notebook list
:
However I restart my pc ,it's the same errors
So it looks like you have a stale nbserver list. This seems to happen sometimes with the notebook.
To clean this up, try executing jupyter --path
:
(py36) imac:~ juhasch$ jupyter --path
config:
/Users/juhasch/.jupyter
/Users/juhasch/anaconda3/envs/py36/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/Users/juhasch/Library/Jupyter
/Users/juhasch/anaconda3/envs/py36/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/Users/juhasch/Library/Jupyter/runtime
Then you will find the stale file in the runtime directory:
(py36) imac:~ juhasch$ ls -al /Users/juhasch/Library/Jupyter/runtime/nbser*
-rw-r--r-- 1 juhasch staff 264 14 Dez 20:30 /Users/juhasch/Library/Jupyter/runtime/nbserver-19710.json
If you remove it, jupyter notebook list
should not report any running servers.
That's meaning that I need to rmdir
the runtime file?
You need to remove the nbserver*.json
file. The kernel*.json
files can be removed too, I guess.
I would not remove the notebook_cookie_secret
file, otherwise I believe your existing notebooks will become untrusted (if you care about that).
Thank you for your kind help, solve the problem of Cannot configure while the Jupyter notebook server is running
, but a new problem has occur as the same partner nick-youngbl
and I try this way to install a new nbextension by this way:
such as I want to use the function of table of contents (2)
but the problem is that:
what a big trouble for me to solve it!!!, for pc:windows, jupyter contrib nbextension install --user
may just do the first things ,and do not do the second. (I guess) . so I need to copy all the extension files into C:\ProgramData\jupyter\nbextensions (the file nbextensions do not include anything ,though I have use the command jupyter contrib nbextension install --user
in cmd)
after I copy all the css and others into it.my notebook has changed!
I had this issue too, for me it appeared to be caused by installing jupyter_nbextensions_configurator in isolation prior to jupyter_contrib_nbextensions.
My solution:
conda remove jupyter_nbextensions_configurator
conda install -c conda_forge jupyter_contrib_nbextensions
(I installed the configurator first as part of BeakerX)
@quant-dc when I tried your solution I got the following message...
PackagesNotFoundError: The following packages are missing from the target environment:
- jupyter_nbextensions_configurator
I still don't have the extensions installed and still keep on getting this error message
jupyter_contrib_nbextensions.install.NotebookRunningError: Cannot configure while the Jupyter notebook server is running
when I run:
conda install -c conda-forge jupyter_contrib_nbextensions
this may be very unscientific but I uninstalled nb_extensions configurator jupyter contrib nbextension uninstall --system
I reinstalled the package and it works
OK, the following worked:
pip install jupyter_contrib_nbextensions jupyter contrib nbextensions install --sys-prefix --skip-running-check
it works Thanks for your help,bro
I'm trying to install the
jupyter_contrib_nbextensions
with conda. I get the following error when trying to install (here, just showing a subset of the error):The conda install prompt shows the following:
I have other jupyter notebooks running but they are in different conda environments in different anaconda installs at various locations on the server. Why is
jupyter_contrib_nbextensions
assessing jupyter notebooks in other isolated conda environments? Do I have to shut down all notebooks in order to installjupyter_contrib_nbextensions
?