CVAT SDK
raw JSON → 2.64.0 verified Fri May 01 auth: no python
CVAT SDK provides a Python client for the Computer Vision Annotation Tool (CVAT) API. Version 2.64.0, requires Python >=3.10. It supports task management, annotation upload/download, and integration with CVAT server. Release cadence is regular, following CVAT releases.
pip install cvat-sdk Common errors
error ModuleNotFoundError: No module named 'cvat_sdk.core' ↓
cause v2.x removed the core subpackage; imports from cvat_sdk.core.models fail.
fix
Change import to
from cvat_sdk.models import Task. error TypeError: Client.__init__() takes 1 positional argument but 3 were given ↓
cause Passing url and auth as positional arguments in v2.x.
fix
Use keyword arguments:
Client(url='http://...', auth=('user', 'pass')). error AttributeError: 'Client' object has no attribute 'create_task' ↓
cause Deprecated method removed or not available in current version.
fix
Use
client.tasks.create(spec). error cvat_sdk.exceptions.ApiException: Not Found ↓
cause Trying to access a task or project that doesn't exist or insufficient permissions.
fix
Verify resource ID and user access rights.
Warnings
breaking v2.x removed the deprecated `cvat_sdk.core` subpackage. Use `cvat_sdk.models` for data classes. ↓
fix Update imports: replace `from cvat_sdk.core.models import Task` with `from cvat_sdk.models import Task`.
breaking `Client` constructor no longer accepts positional arguments for `auth`. Must pass as keyword or use `(user, pass)` tuple. ↓
fix Change `Client('url', 'user', 'pass')` to `Client(url='url', auth=('user', 'pass'))`.
gotcha Image upload methods like `client.tasks.upload_data()` require a data stream or file-like object, not file path as string. ↓
fix Open the file: `with open('image.jpg', 'rb') as f: client.tasks.upload_data(task_id, data=f)`.
deprecated `create_task()` method is deprecated; use `tasks.create()` instead. ↓
fix Call `client.tasks.create(spec)` instead of `client.create_task(spec)`.
Imports
- Client wrong
from cvat_sdk.client import Clientcorrectfrom cvat_sdk import Client - Task wrong
from cvat_sdk.core.models import Taskcorrectfrom cvat_sdk.models import Task
Quickstart
import os
from cvat_sdk import Client
client = Client(
url=os.environ.get('CVAT_URL', 'http://localhost:8080'),
auth=(os.environ.get('CVAT_USER', ''), os.environ.get('CVAT_PASS', ''))
)
print(f"Logged in as {client.user}")