Skip to content
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

nbextensions_configurator validating problems found #37

Closed
lspvic opened this issue Mar 24, 2017 · 7 comments
Closed

nbextensions_configurator validating problems found #37

lspvic opened this issue Mar 24, 2017 · 7 comments
Labels

Comments

@lspvic
Copy link

lspvic commented Mar 24, 2017

when executing jupyter nbextension list, some problem information occurs:

nbextensions_configurator/config_menu/main enabled
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
nbextensions_configurator/tree_tab/main enabled
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

After checking the problem, I found that the nbextension static file are not copied to <jupyter-data-dir>/nbextensions, but the server extension directly adds the static path to nbextension handler, thus it works well. Although it doesn't affect the functionalities, it is still confusing to newcomers.

Currently I'm developing an server extension, and also, a js nbextension. A server extension usually need a cooperational js sextension. The installation flow of the extension for a user is

pip install nb_xxx_extension
jupyter serverextension enable --py nb_xxx_extension
jupyter nbextension install --py nb_xxx_extension
jupyter nbextension enble --py nb_xxx_extension

There are too many steps for users to install an extension.
In this repository, it give an approach to patch nbextensions static resource directly to jupyter application.
There's no need to copy resources, enable nbextensions. But, the validating problem will occur by using this approach.
is it recommended to use this approach
are there some optimization for server extensions development

@jcb91
Copy link
Member

jcb91 commented Mar 25, 2017

Your analysis is pretty much spot-on, I think.

In this repository, it give an approach to patch nbextensions static resource directly to jupyter application.
There's no need to copy resources, enable nbextensions. But, the validating problem will occur by using this approach.

This approach arose because i wanted to simplify the installation process, and ensure that it would never be possible to be missing the JavaScript but have the python for the serverextension, or vice versa. However, again as you pointed out, it brings with it its own problem of spurious validation warnings, which are confusing for end-users.

is it recommended to use this approach
are there some optimization for server extensions development

No, there are no obvious optimizations to the approach, other than reinforcing the link between the js & python sides, as i mentioned. It's not a recommended approach. I would not do this if starting again from scratch, but have stuck with it for now to avoid the pain of issues switching to the standard approach. I think your best course of action depends on use-case. If your serverextension is rendering its own page, then you can add your own handler for js, or just embed it into the page. If on the other hand you have a js extension to an existing notebook page, which will make calls to your serverextension at another URL, then you should use the existing nbextension installation and activation methods. However, to simplify things for the user, you can create a jupyter subcommand to simplify the process with a wrapper script, as seen for example at jupyter_contrib_nbextensions/install.py and jupyter_contrib_nbextensions/application.py. So then, you can simplify to something like

pip install nb_xxx_extension
jupyter nb_xxx_extension enable --sys-prefix

Does that make sense?

@jcb91 jcb91 added the question label Mar 25, 2017
@lspvic
Copy link
Author

lspvic commented Mar 27, 2017

many thanks for your patient and practical advice! @jcb91 thanks.

@jcb91
Copy link
Member

jcb91 commented Mar 28, 2017

you're welcome! 😄

@chrinide
Copy link

chrinide commented May 10, 2017

For my Centos 6.5 system, I also suffer this problems:

root@centos65x64TopHighrunmlqvk h2oai-nae]# jupyter nbextension list
Known nbextensions:
  config dir: /root/.jupyter/nbconfig
    notebook section
      ipyparallel  enabled
      - Validating: problems found:
        - require?  X ipyparallel
      jupyterlab  enabled
      - Validating: problems found:
        - require?  X jupyterlab
      jupyter_contrib_nbextensions  enabled
      - Validating: problems found:
        - require?  X jupyter_contrib_nbextensions
      nbextensions_configurator/config_menu/main  enabled
      - Validating: problems found:
        - require?  X nbextensions_configurator/config_menu/main
      contrib_nbextensions_help_item/main  enabled
      - Validating: OK
    tree section
      nbextensions_configurator/tree_tab/main  enabled
      - Validating: problems found:
        - require?  X nbextensions_configurator/tree_tab/main

@jcb91
Copy link
Member

jcb91 commented May 10, 2017

@chrinide it appears that you've used nbextension enable on a few things which are not actually nbextensions, including ipyparallel, jupyterlab and jupyter_contrib_nbextensions, which are python packages, rather than javascript nbextensions. As mentioned above, the nbextensions_configurator/config_menu/main and nbextensions_configurator/tree_tab/main ones are inserted by the nbextensions_configurator serverextension, so the fact they're listed as missing isn't a problem.

@OrielResearchCure
Copy link

Hello,

I am getting the same validation issue when I am working with Google Datalab notebook. In my case, I am not able to see the extension viz. It is google code that works find on colab notebook.

My code is the following:

`
!jupyter nbextension enable --sys-prefix --py widgetsnbextension
Enabling notebook extension jupyter-js-widgets/extension...
- Validating: OK

!jupyter nbextension list
1
!jupyter nbextension list
Known nbextensions:
config dir: /content/.jupyter/nbconfig
notebook section
nbextensions_configurator/config_menu/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/config_menu/main
tfma_widget_js/extension enabled
- Validating: OK
tree section
nbextensions_configurator/tree_tab/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/tree_tab/main
config dir: /usr/local/envs/py2env/etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK

!jupyter nbextension install --py --symlink tensorflow_model_analysis --sys-prefix

/usr/local/envs/py2env/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/spatial/init.py:96: ImportWarning: Not importing directory '/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/spatial/qhull': missing init.py
from .qhull import *
/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/optimize/_minimize.py:37: ImportWarning: Not importing directory '/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/optimize/lbfgsb': missing init.py
from .lbfgsb import _minimize_lbfgsb
Installing /usr/local/envs/py2env/lib/python2.7/site-packages/tensorflow_model_analysis/static -> tfma_widget_js

  • Validating: OK

    To initialize this nbextension in the browser every time the notebook (or other app) loads:

        jupyter nbextension enable tensorflow_model_analysis --py --sys-prefix
    

!jupyter nbextension list
Known nbextensions:
config dir: /content/.jupyter/nbconfig
notebook section
nbextensions_configurator/config_menu/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/config_menu/main
tfma_widget_js/extension enabled
- Validating: OK
tree section
nbextensions_configurator/tree_tab/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/tree_tab/main
config dir: /usr/local/envs/py2env/etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK

!jupyter nbextension enable tensorflow_model_analysis --py --sys-prefix

/usr/local/envs/py2env/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/spatial/init.py:96: ImportWarning: Not importing directory '/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/spatial/qhull': missing init.py
from .qhull import *
/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/optimize/_minimize.py:37: ImportWarning: Not importing directory '/usr/local/envs/py2env/lib/python2.7/site-packages/scipy/optimize/lbfgsb': missing init.py
from .lbfgsb import _minimize_lbfgsb
Enabling notebook extension tfma_widget_js/extension...
- Validating: OK

!jupyter nbextension list

Known nbextensions:
config dir: /content/.jupyter/nbconfig
notebook section
nbextensions_configurator/config_menu/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/config_menu/main
tfma_widget_js/extension enabled
- Validating: OK
tree section
nbextensions_configurator/tree_tab/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/tree_tab/main
config dir: /usr/local/envs/py2env/etc/jupyter/nbconfig
notebook section
jupyter-js-widgets/extension enabled
- Validating: OK
tfma_widget_js/extension enabled
- Validating: OK

Show data sliced along feature column trip_start_hour.

tfma.view.render_slicing_metrics(tfma_result_1, slicing_column='trip_start_hour')

U2xpY2luZ01ldHJpY3NWaWV3ZXIoY29uZmlnPXsnd2VpZ2h0ZWRFeGFtcGxlc0NvbHVtbic6ICdwb3N0X2V4cG9ydF9tZXRyaWNzL2V4YW1wbGVfY291bnQnfSwgZGF0YT1beydtZXRyaWNzJzrigKY=

`

What looks wrong to you? do you have any recommendation how to fix that.

thanks for any advice,
eilalan

@juhasch
Copy link
Contributor

juhasch commented Jan 6, 2019

@OrielResearchCure: If you still have problems, please try to install the extensions you are using without installing the nbextensions_configurator. If this works well, install the configurator afterwards. If you know run into problems, please open a new issue on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants