jupyter labextension install: version conflict with jupyterlab 4
Resolves `jupyter labextension install` version conflicts against JupyterLab 4 by installing the extension version built for Lab 4 or upgrading the extension. Never forces an incompatible extension onto Lab 4. Not for webpack out-of-memory build failures, and not for extensions that install but do not load.
TL;DR
Lab 4 moved to a new extension API, so extensions built for Lab 3 declare an incompatible peer range and the installer refuses them. Find the extension release whose compatibility range includes your Lab version and install that exact version. If no Lab 4 release exists, either stay on Lab 3 for that extension or drop the extension; forcing the install produces a broken frontend.
jupyter labextension install: version conflict with jupyterlab 4Use this when
jupyter labextension install [name]fails with a peer-dependency or version-range conflict naming jupyterlab 4.- The extension's release notes mention Lab 3 support but nothing about Lab 4.
- You upgraded Lab and a previously working extension now refuses to install.
Not for this skill when
- The install succeeds but the extension does not appear in Lab. That is a build or load problem, not a version conflict.
- The build runs out of memory. That is the webpack OOM case, a different fix.
Steps
- Record exact versions:
jupyter lab --versionand the extension version you tried to install. Expected: you know the Lab 4.x line and the extension's version. - Check the extension's release history for a Lab 4-compatible release (its changelog or compatibility matrix names the supported Lab range). Expected: you find the first extension version that supports Lab 4.
- Install that version explicitly:
jupyter labextension install [name]@[lab4-compatible-version]. Expected: the installer resolves without a conflict error. - Rebuild Lab:
jupyter lab build. Expected: the build completes and lists the extension among the included packages. - Verify in the running Lab: open the extension manager or check
jupyter labextension list. Expected: the extension shows as enabled and valid for the running Lab version. - If no Lab 4 release exists, decide explicitly: pin Lab to 3.x while you need the extension, or remove the extension and move to Lab 4. Expected: a deliberate choice recorded in the environment spec, not a forced install.
Tool compatibility
JupyterLab 4.x (and the 3.x line for the downgrade path); labextension installer as shipped with Lab.
Variant phrasings
labextension incompatible with jupyterlab 4
The general phrasing. Install the extension release built for the Lab 4 API.
jupyterlab 4 extension version conflict
The conflict phrasing. The fix is version selection, never forcing.
extension requires jupyterlab 3 but have 4
The peer-range phrasing. Either downgrade Lab or find the newer extension release.
Why it happens
JupyterLab extensions declare the Lab versions they work with, and Lab 4 introduced breaking changes in the extension API (newer Lumino, new token contracts), so Lab 3 extensions honestly report incompatibility. The installer's refusal is the system working as designed: it prevents a frontend that would fail to load at runtime. The correct move is version alignment in either direction. Forcing past the check with flags or manual package edits bypasses the only guardrail and yields a Lab that builds but shows a broken or missing extension, which is harder to diagnose than the original clean error.
Edge cases / pitfalls
- Prebuilt (pip/conda) extensions and source (npm) extensions version independently. Make sure the Lab 4-compatible release exists in the channel you install from.
- Pinning Lab to 3.x for one extension holds back security and feature updates. Revisit the pin on a schedule.
- After switching extension versions, do a clean rebuild. Stale build artifacts from the old version can linger and confuse verification.
- Agents that install extensions in Dockerfiles should pin both the Lab version and the extension version, or the next rebuild can drift into a conflict.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_sg0FHibY2eNrnU2Rp5WQMg