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

Extensions build error #118

Open
matthhong opened this issue Jan 15, 2021 · 11 comments
Open

Extensions build error #118

matthhong opened this issue Jan 15, 2021 · 11 comments

Comments

@matthhong
Copy link

matthhong commented Jan 15, 2021

While running this command:

jupyter labextension install @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar bqplot jupyter-threejs [email protected] ipysheet ipytree ipycanvas jupyter-matplotlib jupyter-vuetify ipyvolume Check your installation

I get the error:

Building jupyterlab assets (build:prod:minimize) An error occured. RuntimeError: npm dependencies failed to install See the log file for details: /tmp/jupyterlab-debug-anyv5l79.log

The log file has errors of this sort:

> [email protected] build:labextension /home/mih/miniconda3/envs/widgets-tutorial/share/jupyter/lab/staging/node_modules/jupyter-matplotlib
> jupyter labextension build .

Please supply at least one subcommand: check, disable, enable, install, link, list, uninstall, unlink, update
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:labextension: `jupyter labextension build .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:labextension script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mih/.npm/_logs/2021-01-15T18_14_53_268Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack && npm run build:labextension`
npm ERR! Exit status 1
npm ERR!

So far I've tried reinstalling node and jupyter within the environment.

@jasongrout
Copy link
Member

jasongrout commented Jan 15, 2021

Looks like the error is in jupyter-matplotlib extension. Can you try just installing that one extension, and if you see the error again, post an issue over in that repo? https://github.com/matplotlib/ipympl

It looks like the current version of jupyter-matplotlib works with the current version of JupyterLab. See the comment below for jupyterlab 2.

@jasongrout
Copy link
Member

Actually, if you are using jlab 2, you'll now need to use an older version of jupyter-maplotlib. See https://github.com/matplotlib/ipympl#install-an-old-jupyterlab-extension: jupyter labextension install jupyter-matplotlib@7

@jasongrout
Copy link
Member

Since this is a repo for a tutorial at one point in time, the instructions may be out of date at a later point in time, as apparently happened here. Ideally the instructions would be updated to pin all versions as they were when the tutorial was given, or even more ideally, someone will give the tutorial again at some point and update the instructions to current packages.

@matthhong
Copy link
Author

matthhong commented Jan 15, 2021

@jasongrout I resolved the issue as follows:

Firstly, the environment.yml specifies jlab version 2 for installation. For some reason, the error I specified above shows up when installing extensions with jupyter labextension install ... with jlab 2.

So I used the pip install -r requirements.txt instead, which installs jlab version 3. Which makes the aforementioned error go away!

However, with jlab version 3, readers should SKIP the jupyter labextension install ... part altogether.

I don't know exactly, but it seems like all the extensions are covered by installing jlab 3 through pip. For example, in jlab 3, jupyterlab-manager should be installed with pip install jupyterlab_widgets instead of through labextensions, according to https://www.npmjs.com/package/@jupyter-widgets/jupyterlab-manager. But this isn't even necessary: fetching jupyterlab already fetches all the required extensions.

If readers install all the jupyter labextension install ... stuff additionally on jlab3, they will get errors in their javascript console saying the extensions can't be loaded, and will see a Error displaying widget: model not found error in the cells.

Seems to work! Thank you.

@matthhong
Copy link
Author

matthhong commented Jan 18, 2021

Realized the above was ambitious - ipyleaflet throws errors on jlab 3 still (I saw on Gitter it was released for jlab 3 just last week?)

Your solution for jlab 2 works perfectly and I was able to finish the tutorial.

@martinRenou
Copy link
Member

Firstly, the environment.yml specifies jlab version 2 for installation. For some reason, the error I specified above shows up when installing extensions with jupyter labextension install ... with jlab 2.

ipympl and ipyleaflet broke support for jlab 2, unintentionally. I am actually working on fixing it as I am writing.

ipyleaflet throws errors on jlab 3

This is odd though. Would you mind opening an issue on ipyleaflet showing the steps you followed and which error you had?

@matthhong
Copy link
Author

Sounds good

@matthhong
Copy link
Author

matthhong commented Jan 18, 2021

Never mind Martin, I didn't realize requirements.txt for the tutorial had specified ipyleaflet==0.12.6, so my environment still had the old version.

ipyleaflet==0.13.6 is working fine with the tutorial on jlab 3. Thanks!

@martinRenou
Copy link
Member

Good! Happy it works for you

@routineCode
Copy link

routineCode commented Jan 19, 2021

I thoroughly enjoyed the SciPy 2019 JupyterLab tutorial and was looking forward to going through the SciPy 2019 Widgets tutorial in the same way. But it's strange to me that the 2019 version of the Widgets tutorial is no longer available -- or am I missing something?

It seems I'm forced to use this 2020 version (I find the 2020 video less helpful), and yet when I tried to go through the setup, I saw errors similar to matt1hong. But I didn't want to use the pip solution he mentions because I'm just learning how to work within environments and don't know how to do it outside of conda. I spent hours trying to get set up but never could. The widgets never showed up when I used the notebooks.

Is there any other way I can get those notebooks to work? They look great in the videos, but I'm just not experienced enough to get them working -- which, of course, is why I'm going through tutorials ;)

@martinRenou
Copy link
Member

You can still find the 2019 video here: https://www.youtube.com/watch?v=HaSpqsKaRbo&t=5249s. This repository has not changed much since so you can use it while following the video.

JupyterLab 3 came out not so long ago and lots of widgets libraries are not updated. If you stick to JupyterLab 2 and the versions specified here you should be fine.

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

4 participants