nbzip Jupyter Notebook Extension
nbzip is a Jupyter Notebook extension that allows users to compress and download all files within a specified directory directly from the Jupyter interface. It provides a convenient way to archive and retrieve project files from the Jupyter server's filesystem. The current version is 0.1.0. Its release cadence is low, as it's a stable, focused utility.
Common errors
-
ModuleNotFoundError: No module named 'nbzip'
cause The `nbzip` Python package has not been installed in the active Python environment associated with your Jupyter server.fixRun `pip install nbzip` to install the package. -
nbzip functionality (e.g., 'Download directory (.zip)' option) is not visible in Jupyter Notebook/Lab.
cause The `nbzip` Jupyter server extension has been installed but not enabled, or the Jupyter server has not been restarted after enabling.fixFirst, ensure it's installed (`pip install nbzip`). Then, enable it by running `jupyter server extension enable --py nbzip --sys-prefix` and finally restart your Jupyter Notebook or JupyterLab server. -
Permission denied when nbzip attempts to create a zip file or access directories.
cause The user running the Jupyter server process (and thus nbzip) lacks the necessary read/write permissions for the target directories on the server's filesystem.fixEnsure the Jupyter server process has sufficient read/write permissions to the directories you are attempting to archive. This might involve adjusting file system permissions (e.g., `chmod`) or running Jupyter with appropriate user privileges.
Warnings
- gotcha nbzip is a Jupyter server extension and needs to be explicitly enabled after installation for its functionality to appear in the Jupyter UI. Installing the package alone is not sufficient.
- gotcha nbzip operates on the Jupyter server's filesystem. If your Jupyter environment is remote (e.g., a cloud instance), the files compressed and downloaded will be from that remote server, not your local machine.
- gotcha nbzip does not provide Python symbols for direct programmatic access to its compression features within a Python script. Its primary interface is through the Jupyter Notebook or JupyterLab user interface.
Install
-
pip install nbzip -
jupyter server extension enable --py nbzip --sys-prefix
Imports
- No direct user-facing symbols
nbzip is primarily a Jupyter server extension and does not expose commonly imported Python symbols for end-user programmatic use.
Quickstart
pip install nbzip jupyter server extension enable --py nbzip --sys-prefix # Restart Jupyter Notebook/Lab if it's running to apply changes.