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

Setup problem? ImportError: No module named jupyter_nbextensions_configurator.application #653

Closed
Kevin-McIsaac opened this issue Jun 29, 2016 · 19 comments
Labels

Comments

@Kevin-McIsaac
Copy link
Contributor

After pulling from the main branch when I run ./setup.py install I get the error ImportError: No module named jupyter_nbextensions_configurator.application (see full output below).

When I use the About menu item it says I'm running notebook server is 4.2.1. If I open a shell and run jupyter --version it says 4.1.0. Note sure if this is useful but
jupyter --config-dir
/home/ec2-user/.jupyter

jupyter --data-dir
/home/ec2-user/.local/share/jupyter

------- output of running ./setup.py install ---------------------
Running source install...
Extensions and templates path: /home/ec2-user/.local/share/jupyter
Removing previously-installed files to /tmp/ipython-contrib-IPython-notebook-extensions-tTy8nX
Installing Jupyter notebook extensions.
Done!
Configuring extensions...
Traceback (most recent call last):
File "./setup.py", line 54, in
import configure_nbextensions
File "/tmp/IPython-notebook-extensions/configure_nbextensions.py", line 7, in
from jupyter_nbextensions_configurator.application import main as jnc_app_main
ImportError: No module named jupyter_nbextensions_configurator.application

@jcb91
Copy link
Member

jcb91 commented Jun 29, 2016

ugh, sorry, this is my fault, introduced in #644, and related to our non-standard setup script. Essentially one of the requirements is required in order to run the setup script, not just for use after it's run. You can fix it by pip-installing the module in question jupyter_nbextensions_configurator, but I'll also push a fix in a minute or so.

@jcb91
Copy link
Member

jcb91 commented Jun 29, 2016

ok, should be done - let me know!

@Kevin-McIsaac
Copy link
Contributor Author

I reran setup after pulling the changed but got the same error. I checked setup and I have the modified version that requires .

I use pip to install jupyter_nbextensions_configurator and the setup now works and nbextensions page is working again. I did note that in the nbextensions page the extention config/config_menu/main is greyed out and marked possibly incompatible, that the nbextentions page is not in the note book edit menu and not on a tab on the dash board.

@jcb91
Copy link
Member

jcb91 commented Jun 29, 2016

oh bummer, I guess I've misunderstood how setup_requires works, then.

The other remaining problems you note seem also to stem from the transition to jupyter_nbextensions_configurator.

the extention config/config_menu/main is greyed out

this may be the old uri still enabled in config (see below). If you allow configuring 'incompatible' extensions, you ought to be able to check what it says about compatibility?

the nbextentions page is not in the note book edit menu

That was provided by the config menu extension, which was removed from this repo as it's now provided by jupyter_nbextensions_configurator. You'll need to re-enable it from the config page, as its require uri has changed (from config/config_menu/main to nbextensions_configurator/config_menu/main).

not on a tab on the dash board

this is not enabled by default - did you enable the Nbextensions dashboard tab nbextension?

@Kevin-McIsaac
Copy link
Contributor Author

  1. Duh, didn't realise I need to enable Nbextensions dashboard tab. Enabled that and it works fine!

  2. I turned off "disable configuration for extensions without explicit compatibility" but the edit menu item is still missing. The extension has this message

    config/config_menu/main
    This extension is enabled in the notebook json config, but doesn't provide a yaml file to tell us how to configure it. You can still enable or disable it from here, though.
    section: notebook
    compatibility: ?.x

My thought is this config/config_menu/main can be deprecated in favor of Nbextensions dashboard tab

@Kevin-McIsaac
Copy link
Contributor Author

  1. Duh, didn't realise I need to enable Nbextensions dashboard tab. Enabled that and it works fine!
  2. I turned off "disable configuration for extensions without explicit compatibility" but the edit menu item is still missing. I then noticed a new extension called "Nbextensions edit menu item", which provide this functionality. Suggest config/config_menu/main be removed

@jcb91
Copy link
Member

jcb91 commented Jun 30, 2016

Duh, didn't realise I need to enable Nbextensions dashboard tab

others have made the same assumption, so I think eventually it will make sense to have it enabled by default. For now, I don't have the mechanism written to do that reliably, but I'm working on stuff that will provide it as a side-effect.

I turned off "disable configuration for extensions without explicit compatibility" but the edit menu item is still missing. I then noticed a new extension called "Nbextensions edit menu item", which provide this functionality. Suggest config/config_menu/main be removed

Yeah, what's going on here is that the installation of the new version doesn't take account of the fact that config/config_menu/main actually has been removed, so its enabled status remains in the notebook config files. Really, I suppose what should happen here is a migration of the enabled status from the old require uri to the new one, but again, this would rely on code I haven't fully written yet. Or perhaps I should have kept the name the same, so it was clearer what was going on 😕

@wsshin
Copy link

wsshin commented Jul 2, 2016

I have a similar error during setup. I am installing IPython-notebook-extensions for the first time, and this is the error message I get:

$ ./setup.py install
Running source install...
Extensions and templates path: /Users/XXX/Library/Jupyter
Removing previously-installed files to /var/folders/mg/hm3bnvhs7dxc5x2tbhy410q80000gp/T/ipython-contrib-IPython-notebook-extensions-9m1g_fs3
Installing Jupyter notebook extensions.
Done!
Configuring extensions...
Traceback (most recent call last):
  File "./setup.py", line 54, in <module>
    import configure_nbextensions
  File "/Users/XXX/packages/IPython-notebook-extensions/configure_nbextensions.py", line 7, in <module>
    from jupyter_nbextensions_configurator.application import main as jnc_app_main
ImportError: No module named 'jupyter_nbextensions_configurator'

Hope this helps.

@jcb91
Copy link
Member

jcb91 commented Jul 13, 2016

This should (hopefully) have been fixed in b148511, so hopefully doesn't happen with latest repo version - can we close this?

@gcbgit
Copy link

gcbgit commented Jul 14, 2016

I'm still getting the error after doing a pull about 5 min ago, so I don't think it's been fixed yet. I'm assuming the fix was meant to be in b148511?

This after a 'conda update --all', so iPython, Jupyter and the rest are at their anaconda latest.

Doing a 'pip install jupyter_nbextensions_configurator' before ./setup.py install seemed to do the trick.

@jcb91 jcb91 added the bug label Jul 15, 2016
@jcb91
Copy link
Member

jcb91 commented Jul 15, 2016

I'm still getting the error after doing a pull about 5 min ago

Ok, so it isn't fixed, and this should stay open.

Doing a 'pip install jupyter_nbextensions_configurator' before ./setup.py install seemed to do the trick.

Yes, it would. Essentially what's going on is that the jupyter_nbextensions_configurator module is used in the setup.py script to enable itself. However, pip/setuptools doesn't install a package's runtime dependencies before attempting to install the package, so the setup.py script fails if jupyter_nbextensions_configurator is missing. I attempted to fix this in b148511 using setuptools' setup_requires field, but it doesn't seem to have worked. I'm not completely sure how setup_requires options are intended to work, so I guess I should investigate (should have investigated before assuming it would solve the problem 😢).

@jcb91
Copy link
Member

jcb91 commented Jul 15, 2016

for reasons I still don't understand, it seems that although running

python setup.py install

fails because of the missing jupyter_nbextensions_configurator, running

 `pip install .`

respects the setup_requires kwarg, and install correctly. Weird.

@jcb91
Copy link
Member

jcb91 commented Jul 29, 2016

Closing, as this should now be fixed (or rather, avoided) by our shiny new two-part installation method. As always, reopen if I'm wrong!

@jcb91 jcb91 closed this as completed Jul 29, 2016
@fonnesbeck
Copy link

I am getting this error in the terminal after starting the notebook (rather than at installation):

[I 07:45:14.481 NotebookApp] Loading IPython parallel extension
[W 07:45:14.484 NotebookApp] Error loading server extension jupyter_nbextensions_configurator
    Traceback (most recent call last):
      File "/Users/fonnescj/anaconda3/envs/bios8366/lib/python3.5/site-packages/notebook/notebookapp.py", line 1166, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/Users/fonnescj/anaconda3/envs/bios8366/lib/python3.5/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 986, in _gcd_import
      File "<frozen importlib._bootstrap>", line 969, in _find_and_load
      File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
    ImportError: No module named 'jupyter_nbextensions_configurator'

Should this be a separate issue, or should this be re-opened?

Running the current master on Python 3.5 (OS X).

@jcb91
Copy link
Member

jcb91 commented Sep 13, 2016

@fonnesbeck weird, seems like for some reason the configurator hasn't been installed correctly. However, this should probably go to a new issue, as it seems to be a different root cause. For the new issue, please add your install method (conda, pip etc) & any output that you get from the install.

@eromoe
Copy link

eromoe commented Dec 26, 2017

from #1115
python -m pip install --user jupyter_contrib_nbextensions solve this problem

@impanda-cookie
Copy link

@eromoe

Thanks ! It's helpful for me

@AEcomp
Copy link

AEcomp commented May 30, 2018

Hello,
you mentioned Configurable nbextension: "disable configuration for nbextensions without explicit compatibility".
I cannot find a answer how to disable it via command line instead of clicking the button.
What do I miss?

@4Z4T4R
Copy link

4Z4T4R commented Aug 3, 2018

One last comment to this in the case that you are using Anaconda to virtual env your Python install and you are also getting the error @fonnesbeck enumerates above: Re-source your conda environment. The easiest way to do that is open another window and your environment will reload. Then, shazaam!

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

9 participants