Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
464 views
in Technique[技术] by (71.8m points)

python - Unable to install jupyterlab-execute-time extension

Whenever I try to install jupyterlab-execute-time extension, I get the following error . Is there any solution to the problem? I'm using Jupyter Lab version 3.0.14.

Extension Installation Error

Extension Installation Error
An error occurred installing <code>jupyterlab-execute-time</code>.

Error message:

The extension "jupyterlab-execute-time" does not yet support the current version of JupyterLab.


Conflicting Dependencies:
JupyterLab                  Extension      Package
>=3.0.9 <3.1.0              >=2.0.2 <3.0.0 @jupyterlab/application
>=3.0.9 <3.1.0              >=2.0.2 <3.0.0 @jupyterlab/notebook
>=3.0.5 <3.1.0              >=2.0.1 <3.0.0 @jupyterlab/settingregistry
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

TLDR:

pip install jupyterlab_execute_time  # or, if using conda:
# conda install -c conda-forge jupyterlab_execute_time

Explanation:

It appears that you are trying to use the old way of installing extensions (jupyter labextension install @org/extension-name, which is also the way the Extension Manager installs extensions), which used NPM servers to download code and required users to have a Node.js installed (to compile the code).

However, since JupyterLab 3.0 extensions may no longer require Node.js to be installed; they use a new prebuilt extensions mechanism (also known as federated extensions), which means that they no longer require compilation. The requirement to use NPM for distribution no longer applies either. Instead, it is now common for authors to distribute extensions via other channels such as PyPI or conda-forge (because if someone has JupyterLab installed, they most likely used one of these two distribution channels).

Extension authors targeting the JupyterLab 3.0+ can choose to either:

  1. continue publishing on NPM and ignore the new federated extensions mechanism, or
  2. adapt federated extensions and start publishing to PyPI/conda-forge only, or
  3. publish to both NPM and PyPI/conda-forge

In case of jupyterlab-execute-time the author went the (2) route, only publishing to PyPI/conda-forge, with the latest published release as for the day of writing being 2.0.2 on PyPI; the NPM package however was not removed and it remained on the old version 1.1.0 on NPM (which is good for users who still have to use the old JupterLab 2.x line). You may wish to contact the author on GitHub and ask them to publish a new version on NPM, which they may refuse given that it comes with extra maintenance cost and not that much benefit (the benefit is mostly for users who use the built-in Extension Manager because it still has not been updated to work with PyPI/conda-forge installation, but this is a feature is on the roadmap - please do contribute if you can).

To easily check what is the situation for other extensions please carefully read the installation instruction on both the GitHub, PyPI, and the NPM page if one exists; in the case of jupyterlab_execute_time you can clearly see that the NPM version was not updated for JupyterLab 3.0 (see the blue highlight):

enter image description here

Whereas the version on PyPI (and GitHub) was (see yellow highlight):

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...