Registry / devops / b2
library4.7.1pypypiunverified

The `b2` package provides the official Command Line Tool for Backblaze B2 cloud storage. It allows users to manage files, buckets, and account settings directly from their terminal. The current version is 4.6.0, and it follows a frequent release cadence, often patching fixes and improving compatibility with newer Python versions or underlying SDK changes.

pip install b2
INSTALL
IMPORT
SIG · B2
B
b2
devopspythonv4.7.1
Install
3.6s avg
Import
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 35.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.6s · import 0.000s · 36MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

b2
This package is a CLI tool and not intended for direct programmatic import.
import b2
For programmatic access to Backblaze B2 via Python, use the `b2sdk` library instead (e.g., `from b2sdk.v3 import B2Api`). The `b2` package itself is the command-line interface.

First, install the `b2` CLI. Then, authorize your account using your Backblaze B2 Application Key ID and Application Key (which can be obtained from your B2 console). You can pass these as environment variables or directly. After authorization, you can list your buckets and upload files. Replace `$B2_ACCOUNT_ID`, `$B2_APPLICATION_KEY`, `my-bucket-name`, `local-file.txt`, and `remote-file-name.txt` with your actual values.

pip install b2 b2 authorize-account $B2_ACCOUNT_ID $B2_APPLICATION_KEY b2 bucket list b2 upload-file my-bucket-name local-file.txt remote-file-name.txt
b2 --version
Debug
Known issues
breakingSupport for Python 3.8 was officially dropped starting with `b2` version 4.5.0.
fix
Upgrade your Python environment to 3.9 or newer. If you must use Python 3.8, pin your `b2` dependency to a version less than 4.5.0 (e.g., `pip install "b2<4.5.0"`).
affects: >=4.5.0
gotchaOn Python 3.14+, users might encounter `SystemError: <built-in function _io_q_write_impl> returned a result with an error set` due to a buffer overflow in a dependency's terminal size detection.
fix
Upgrade `b2` to version 4.5.0 or later (`pip install --upgrade b2`), which includes a fix for this issue.
affects: <4.5.0, on Python 3.14+
gotchaShell autocompletion features can be flaky or require re-installation after `b2` upgrades or Python version changes, especially on newer Python versions (3.12+, 3.14+).
fix
After installing or upgrading `b2`, run `b2 autocomplete install` to ensure autocompletion is properly configured for your shell. Refer to the `b2 autocomplete` documentation for specific shell instructions.
affects: <4.6.0, various Python versions
gotchaThe `b2` CLI internally migrated to `b2sdk.v3` in v4.4.0. While this primarily impacts the underlying implementation, it signifies a major internal change. Users attempting to interact with B2 programmatically via Python should directly use `b2sdk` (specifically `b2sdk.v3`), not attempt to import internal components from the `b2` CLI package.
fix
For programmatic Python access, `pip install b2sdk` and use `from b2sdk.v3 import B2Api` for up-to-date functionality.
affects: >=4.4.0
Upgrade
Version history
4.7.1latest on PyPI · released Jun 8, 2026
Audit
Dependencies
b2sdkrequiredCore library for interacting with Backblaze B2 API, used internally by the CLI.
Agent activity
14 hits · last 30 days
node
14
Resources
b2 — pip install b2 · libregistry