You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

JupyterLab扩展能否离线下载后安装?求具体操作方法

Offline Installation of JupyterLab Extensions: Step-by-Step Guide

Absolutely, you can install JupyterLab extensions offline—here’s how to turn the official docs’ vague notes into concrete, actionable steps for each supported scenario:

Scenario 1: Install from a Local Extension Directory

If you have the full source code of the extension (e.g., a cloned repo or extracted folder):

  • First, build the extension (skip this if it’s already pre-built):
    Navigate to the extension directory in your terminal and run:
    npm install
    npm run build
    
  • Install it to JupyterLab:
    jupyter labextension install ./path/to/your/extension/directory
    
  • Rebuild JupyterLab to activate the extension:
    jupyter lab build
    

Scenario 2: Install from a Local Gzip Package (.tgz)

If you have a compressed gzip package of the extension (standard for npm-hosted extensions):

  • Transfer the .tgz file to your offline machine (via USB, network share, etc.).
  • Run the install command pointing directly to the file:
    jupyter labextension install ./path/to/your/extension/package.tgz
    
  • Rebuild JupyterLab to apply changes:
    jupyter lab build
    

Bonus: Simpler Offline Install for JupyterLab 3.x+

For JupyterLab 3.0 and later, many extensions are distributed as Python wheels (via PyPI), which skips the build step entirely:

  1. On an internet-connected machine, download the wheel file:
    pip download <extension-package-name>
    
    This saves a .whl file in your current directory.
  2. Transfer the .whl file to your offline machine.
  3. Install it with pip (no JupyterLab rebuild needed—wheels include pre-built assets):
    pip install ./path/to/extension-package.whl
    

How to Get the Extension Package (If You Don’t Have It Yet)

If you need to download the package first (from an internet-connected machine):

  • For npm-hosted extensions, generate the .tgz file with:
    npm pack <extension-npm-name>
    
  • Or use JupyterLab’s built-in download command:
    jupyter labextension download <extension-name>
    
    The package will be stored in JupyterLab’s cache—find its path by running jupyter labextension list and checking the "cache location" line.

Note: Always verify the extension version is compatible with your JupyterLab version to avoid installation errors.

内容的提问来源于stack exchange,提问作者matanc1

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:34:18