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

does not install with conda, but with pip #43

Closed
IreneCrisologo opened this issue Sep 24, 2017 · 15 comments
Closed

does not install with conda, but with pip #43

IreneCrisologo opened this issue Sep 24, 2017 · 15 comments

Comments

@IreneCrisologo
Copy link

Hi,

I tried installing the extensions configurator using conda install -c conda-forge jupyter_nbextensions_configurator but it won't install, but also won't give any error messages. It just pushes through, but the configuration tab never appeared.

I then tried installing using pip install jupyter_nbextensions_configurator then jupyter nbextensions_configurator enable --user which worked.

@pybokeh
Copy link

pybokeh commented Sep 26, 2017

Same problem. I get a blank nbextensions config tab. pip installation didn't work for me.

@IreneCrisologo
Copy link
Author

@pybokeh there was also no error messages or anything with pip install? Can you show us what you did?

@pybokeh
Copy link

pybokeh commented Sep 26, 2017

I get no error messages at all. It even says "OK" when validation message is echoed when activating the extension.

I'm on Windows 7 machine at work with no admin rights.

I create 2 environment variables so that I can use the --user flag when installing the extensions and extension configurator and then activate my virtual environment using conda:
set JUPYTER_CONFIG_DIR=d:\.jupyter
set JUPYTER_DATA_DIR=d:\.jupyter

I install the notebook extensions with pip:
pip install jupyter_contrib_nbextensions, then do: jupyter contrib nbextension install --user

I install the notebook extensions configurator with pip:
pip install jupyter_nbextensions_configurator, then do: jupyter nbextensions_configurator enable --user

I confirm the extensions are installed at the location per JUPYTER_DATA_DIR environment variable by navigating to:
D:\.jupyter\nbextensions and see that all the extensions folders/installation files are present

Then I launch jupyter notebook via "jupyter notebook" at command prompt.

I open one of my notebooks, go to "Edit", then choose "nbextensions config" item. A new browser tab is generated, but it is not showing anything.

@jcb91
Copy link
Member

jcb91 commented Sep 26, 2017

Right, this sounds like an issue with the configurator's enable, or possibly with the env vars. I take it you have the same environment variables set while running the notebook server, so that it looks for config in the right place?

If you run the

jupyter nbextensions_configurator enable --user

Command with the --debug flag, it should hopefully tell you which config file gets edited. Also use the same --debug flag on your server run command to show which config files it loads, and hopefully that may shed some light on where the issue arises...

@pybokeh
Copy link

pybokeh commented Sep 26, 2017

Yes, my environment variables were set prior to running the jupyter notebook server.

Here is output from enabling configurator with --debug flag:

(notebook) D:\Console2>jupyter nbextensions_configurator enable --user --debug
Searching ['D:\\Console2', 'd:\\.jupyter', 'd:\\miniconda3\\envs\\notebook\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
Looking for jupyter_config in C:\ProgramData\jupyter
Looking for jupyter_config in d:\miniconda3\envs\datascience\etc\jupyter
Looking for jupyter_config in d:\.jupyter
Looking for jupyter_config in D:\Console2
Looking for jupyter nbextensions_configurator enable_config in C:\ProgramData\jupyter
Looking for jupyter nbextensions_configurator enable_config in d:\miniconda3\envs\notebook\etc\jupyter
Looking for jupyter nbextensions_configurator enable_config in d:\.jupyter
Looking for jupyter nbextensions_configurator enable_config in D:\Console2
Enabling: jupyter_nbextensions_configurator
- Writing config: d:\.jupyter
    - Validating...
      jupyter_nbextensions_configurator  ok
Enabling notebook nbextension nbextensions_configurator/config_menu/main...
Enabling tree nbextension nbextensions_configurator/tree_tab/main...

Here is output from running jupyter notebook with --debug flag:

(notebook) D:\Console2>jupyter notebook --debug
[D 15:35:19.711 NotebookApp] Searching ['D:\\Console2', 'd:\\.jupyter', 'D:\\Miniconda3\\envs\\notebook\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
[D 15:35:19.712 NotebookApp] Looking for jupyter_config in C:\ProgramData\jupyter
[D 15:35:19.713 NotebookApp] Looking for jupyter_config in D:\Miniconda3\envs\notebook\etc\jupyter
[D 15:35:19.714 NotebookApp] Looking for jupyter_config in d:\.jupyter
[D 15:35:19.714 NotebookApp] Looking for jupyter_config in D:\Console2
[D 15:35:19.715 NotebookApp] Looking for jupyter_notebook_config in C:\ProgramData\jupyter
[D 15:35:19.716 NotebookApp] Looking for jupyter_notebook_config in D:\Miniconda3\envs\notebook\etc\jupyter
[D 15:35:19.717 NotebookApp] Loaded config file: D:\Miniconda3\envs\notebook\etc\jupyter\jupyter_notebook_config.json
[D 15:35:19.718 NotebookApp] Looking for jupyter_notebook_config in d:\.jupyter
[D 15:35:19.719 NotebookApp] Loaded config file: d:\.jupyter\jupyter_notebook_config.py
[D 15:35:19.720 NotebookApp] Loaded config file: d:\.jupyter\jupyter_notebook_config.json
[D 15:35:19.720 NotebookApp] Looking for jupyter_notebook_config in D:\Console2
[D 15:35:20.522 NotebookApp] Terminals not available (error was No module named 'terminado')
[D 15:35:20.563 NotebookApp] [jupyter_nbextensions_configurator] Loading 0.2.7
[D 15:35:20.563 NotebookApp] [jupyter_nbextensions_configurator]   Editing templates path to add D:\Miniconda3\envs\notebook\lib\site-packages\jupyter_nbextensions_configurator\templates
[D 15:35:20.564 NotebookApp] [jupyter_nbextensions_configurator]   Editing nbextensions path to add D:\Miniconda3\envs\notebook\lib\site-packages\jupyter_nbextensions_configurator\static
[D 15:35:20.564 NotebookApp] [jupyter_nbextensions_configurator]   Adding new handlers
[I 15:35:20.565 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.2.7
[I 15:35:20.812 NotebookApp] Serving notebooks from local directory: D:\jupyter
[I 15:35:20.812 NotebookApp] 0 active kernels
[I 15:35:20.812 NotebookApp] The Jupyter Notebook is running at:
[I 15:35:20.813 NotebookApp] http://localhost:8888/jupyter/
[I 15:35:20.813 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

@jcb91
Copy link
Member

jcb91 commented Sep 26, 2017

Hmm, well that output certainly looks like it's all working as expected, the configurator certainly logs its setup, anyway. I note that you're using a non-default base_url, but that shouldn't matter, as it works in tests. Does the nbextensions tab appear in the tree/browser view? What's the URL that the menu item redirects you to (which gives the blank page you mentioned)? Is there anything it the browser JavaScript console on the blank page?

@pybokeh
Copy link

pybokeh commented Sep 27, 2017

@jcb91 Oh wow I totally forgot that there is an existing "Nbextensions" tab which points to URL: http://localhost:8888/jupyter/tree?#nbextensions_configurator This actually works!

It's the one in the "Edit" menu on an opened notebook that provides a different URL
http://localhost:8888/jupyter/nbextensions/
which does not work. Looks like we now know what the problem is.

I created a clean, separate virtual environment and used the --sys-prefix flag instead of the --user flag and I am still getting same problem, so I don't think it is anything unique to my machine or setup.

@jcb91
Copy link
Member

jcb91 commented Sep 27, 2017

Hmm, ok. Anything in the javascript console on the blank http://localhost:8888/jupyter/nbextensions/ page?

@jcb91
Copy link
Member

jcb91 commented Sep 27, 2017

@IreneCrisologo, when you mention

it won't install, but also won't give any error messages. It just pushes through, but the configuration tab never appeared

Do you mean the tab on the tree page? Is there any output from the install process at all? I'm struggling to think of a reason this might happen 😕

@pybokeh
Copy link

pybokeh commented Sep 27, 2017

@jcb91 Sorry I am not a developer or have extensive web development knowledge and so I am not sure how to best share the output of my browser's web console.

Below is copy/paste of the console output with some manual formatting I did, there were 7 entries:

  1. Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead --> jquery.min.js:1

  2. Loading failed for the <script> with source “http://localhost:8888/jupyter/static/jed.js?v=20170927073423”. --> nbextensions:1

  3. Error: Script error for "jed", needed by: base/js/i18n
    http://requirejs.org/docs/errors.html#scripterror --> require.js:165:17

  4. Loading failed for the <script> with source “http://localhost:8888/jupyter/static/json.js?v=20170927073423”. --> nbextensions:1

  5. Error: Script error for "json", needed by: json!base/../../i18n/nbjs.json_unnormalized2
    http://requirejs.org/docs/errors.html#scripterror --> require.js:165:17

  6. Use of getPreventDefault() is deprecated. Use defaultPrevented instead. --> jquery.min.js:5:12747

  7. Error: Load timeout for modules: json!base/../../i18n/nbjs.json_unnormalized2
    http://requirejs.org/docs/errors.html#timeout --> require.js:165:17

@IreneCrisologo
Copy link
Author

@jcb91 yes the tab on the tree page and the option on the edit tab never appeared. The output from the install process didn't show any error or any sign of error, so I really thought it pushed through. I tried installing it while jupyter is open, and it didn't appear, so i tried installing it after closing all jupyter notebooks. Still didn't appear. Tried installing after restarting laptop, still didn't appear.

I saw in the issues list in jupyter nbextensions github saying someone had a problem installing it with conda and tried using pip instead. I had the same problem, so I installed my nbextensions with pip. When conda didn't work for the nbextensions configurator, i went with pip again.

.... wait ... could that be the reason? Because I installed the nbextensions with pip, the configurator will only work when installed using pip?

@jcb91
Copy link
Member

jcb91 commented Sep 28, 2017

Sorry I am not a developer or have extensive web development knowledge and so I am not sure how to best share the output of my browser's web console.

No problem. Your version is fine; I usually just cut-and-paste without editing into a markdown code block.

Unfortunately, I can't see anything in that that seems like a reason for the whole page to fail to load. I must admit I don't recognise the jed.js script, or any of the i18n stuff (although the i18n is normally used for translation stuff, I think?). I suppose the load timeout for modules could in principal be indirectly leading to the page failing to load. Are you using any other server extensions? What's your notebook version?

@jcb91
Copy link
Member

jcb91 commented Sep 28, 2017

@IreneCrisologo that certainly sounds like it should have installed ok 😞

.... wait ... could that be the reason? Because I installed the nbextensions with pip, the configurator will only work when installed using pip?

Not really. The nbextensions should install the configurator as a dependency anyway, regardless of if that's through pip or conda. Both should work regardless of what combination of pip/conda was used to install them. Though at the moment contrib_nbextensions may fail to install its config/files while complaining about running notebook servers, which may or may not actually be running, the configurator doesn't perform these checks, so shouldn't be affected.

@jcb91
Copy link
Member

jcb91 commented Sep 30, 2017

This (the standalone /nbextensions url not working correctly) appears to be a bug introduced by Jupyter 5.1.0's adoption of i18n translation breaking the standalone page somehow. Not entirely sure how, as yet, but will investigate...

@jcb91
Copy link
Member

jcb91 commented Oct 7, 2017

This should hopefully be fixed by #44, which is incorporated into the latest conda & pip versions (0.2.8). As always, please reopen if it's still a problem after upgrading!

@jcb91 jcb91 closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants