Registry / ai-ml / roboflow

roboflow

JSON →
library1.4.1pypypi✓ verified 27d ago

The Roboflow Python package (version 1.3.1) is the official SDK for interacting with the Roboflow API, enabling programmatic access for tasks such as dataset management, image upload, model training, and inference. It is actively developed, with recent updates including a comprehensive rewrite of the command-line interface and enhanced capabilities for workspace-level asset management.

pip install roboflow
INSTALL
IMPORT
SIG · ROBOFLOW
R
roboflow
ai-mlpythonv1.4.1
Install
11.7s avg
Import
654ms
Disk
364MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.4.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.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 11.7s · import 0.654s · 363MB
364MB installed
● package 364MB
Code
Verified usage

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

Roboflow
✓ from roboflow import Roboflow

Initializes the Roboflow client and demonstrates connecting to a workspace. It's recommended to store your API key in an environment variable for security.

import os from roboflow import Roboflow # Ensure your Roboflow API key is set as an environment variable (recommended) # os.environ["ROBOFLOW_API_KEY"] = "YOUR_API_KEY" # Initialize Roboflow with your API key # Replace 'YOUR_ROBOFLOW_API_KEY' with os.environ.get("ROBOFLOW_API_KEY", "") for production rf = Roboflow(api_key=os.environ.get("ROBOFLOW_API_KEY", "")) # Example: Get a workspace (replace 'your-workspace-id' with your actual workspace ID) # You can often omit the ID if you only have one workspace associated with your API key try: workspace = rf.workspace("your-workspace-id") print(f"Connected to workspace: {workspace.name}") except Exception as e: print(f"Could not connect to workspace: {e}. Check your API key and workspace ID.") # Example: List projects in the workspace # if 'workspace' in locals(): # projects = workspace.projects() # print(f"Projects in workspace: {[p.name for p in projects]}")
roboflow --version
Debug
Known issues
breakingThe v1.3.1 release introduced a complete rewrite of the Roboflow CLI. Users who programmatically invoked CLI commands (e.g., via `subprocess`) will find command structures, argument patterns (`noun verb`), and output formats (e.g., `--json` output) have fundamentally changed. While the Python SDK's core programmatic interface (`roboflow.Roboflow` class) remains stable, direct CLI interaction patterns are now significantly different.
fix
Review the updated Roboflow CLI documentation for the new command structure and output formats. Adapt any scripts or automation workflows that relied on the older CLI behavior.
affects: >=1.3.1
gotchaWhen working with HEIF (.heic/.heif) image formats, users on Python 3.9 might encounter issues due to a dependency (`pi_heif`) dropping support for Python 3.9 around Roboflow v1.2.13. This is a dependency-related incompatibility rather than a core Roboflow SDK issue.
fix
Upgrade your Python environment to 3.10 or newer if you need to process HEIF images with the Roboflow SDK. Alternatively, avoid HEIF images on Python 3.9.
affects: >=1.2.13 (when using Python 3.9 for HEIF processing)
gotchaFor security and best practice, your Roboflow API key should always be loaded from environment variables (e.g., `os.environ["ROBOFLOW_API_KEY"]`) rather than being hardcoded directly into your scripts. Hardcoding keys can lead to security vulnerabilities if your code is exposed.
fix
Set your `ROBOFLOW_API_KEY` as an environment variable. When initializing, use `rf = Roboflow(api_key=os.environ.get("ROBOFLOW_API_KEY", ""))` to safely retrieve it.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'roboflow'
The `roboflow` package has not been installed in the current Python environment.
fix
pip install roboflow
roboflow.core.roboflow_error.RoboflowError: Authentication failed. Please check your API key.
The provided Roboflow API key is incorrect, expired, or lacks the necessary permissions for the requested action.
fix
Obtain a valid API key from your Roboflow workspace settings and ensure it is passed correctly during initialization, e.g., `rf = Roboflow(api_key='YOUR_API_KEY')`.
Exception: Project '<workspace_name>/<project_name>' not found in workspace.
The specified workspace name or project name provided to `rf.workspace.project()` does not exist or is misspelled.
fix
Verify the exact workspace name and project name from your Roboflow account dashboard and ensure they match your code.
roboflow.core.roboflow_error.RoboflowError: There was an error while predicting, please check your image and model settings.
This general error indicates an issue during the prediction process, often due to an invalid input image, an uninitialized model, or missing dependencies like `opencv-python`.
fix
Ensure the input image is valid (correct path, format, not corrupted), the model is correctly loaded and initialized, and all necessary dependencies (e.g., `pip install opencv-python`) are installed.
roboflow.core.exceptions.RoboflowError: You must be logged in to Roboflow to perform this action.
Roboflow attempted an API operation that requires authentication, but a successful login session was not established or has expired.
fix
Call `roboflow.login(api_key="YOUR_API_KEY")` with a valid API key, or ensure the `ROBOFLOW_API_KEY` environment variable is correctly set before importing `roboflow`.
Upgrade
Version history
1.4.1latest on PyPI · released Aug 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
roboflow — pip install roboflow · libregistry