Jupyter Archive
Jupyter Archive is a JupyterLab extension that enables users to create, download, and extract archive files (zip, tar, tar.gz, tar.bz2) directly within the JupyterLab user interface. It is currently at version 3.4.0 and is maintained as part of the JupyterLab Contrib ecosystem, typically seeing releases aligned with JupyterLab major versions or for significant bug fixes.
Common errors
-
JupyterLab could not load the @jupyterlab-contrib/jupyter-archive extension.
cause The frontend extension assets might not be properly built or loaded, or there's a version mismatch with JupyterLab.fixFirst, ensure `jupyter-archive` is installed: `pip install jupyter-archive`. Then, try rebuilding JupyterLab assets: `jupyter lab build`. If on an older JupyterLab version (<3.0), you might need `jupyter labextension install @jupyterlab-contrib/jupyter-archive` (though rarely needed for modern Lab). -
ModuleNotFoundError: No module named 'jupyter_archive'
cause Attempting to `import jupyter_archive` in a Python script or notebook, assuming it's a standard library for direct use.fixThis library is a JupyterLab *extension* primarily for UI interaction, not direct programmatic Python imports for user code. Use its functionality through the JupyterLab file browser UI. -
Error creating archive: [Errno 13] Permission denied: '/path/to/protected/directory'
cause The JupyterLab server process lacks the necessary write permissions for the specified directory where the archive is being created or extracted.fixCheck the permissions of the target directory (`/path/to/protected/directory`). Either choose a different directory where the JupyterLab user has write access, or modify the directory permissions (e.g., `chmod 775 /path/to/protected/directory` or change ownership).
Warnings
- breaking JupyterLab extensions can be sensitive to major version upgrades of JupyterLab itself. While `jupyter-archive` aims for compatibility, ensure your `jupyter-archive` version supports your `jupyterlab` version, especially when upgrading JupyterLab from 3.x to 4.x or newer.
- gotcha Archiving or extracting very large files/directories can consume significant server resources (CPU, RAM) and take a long time, potentially leading to timeouts if JupyterLab is hosted with strict resource limits or slow I/O.
- gotcha Permissions errors are common when attempting to create or extract archives in directories where the JupyterLab server process does not have write access.
Install
-
pip install jupyter-archive
Imports
- jupyter_archive
This is a JupyterLab extension primarily interacted with via the UI. There are no common direct Python imports for user-facing functionality.
Quickstart
pip install jupyter-archive jupyter lab