{"id":8974,"library":"encord","title":"Encord Python SDK","description":"Encord is an end-to-end platform for AI-assisted annotation, quality control, and data management for computer vision and multimodal AI. The Encord Python SDK client allows programmatic interaction with the Encord API to create automated pipelines and integrate Encord functionalities directly into existing MLOps workflows. The library is currently at version 0.1.192 and is actively maintained with frequent updates, including multiple releases within the last month.","status":"active","version":"0.1.192","language":"en","source_language":"en","source_url":"https://github.com/encord-team/encord-client-python","tags":["computer-vision","mlops","data-annotation","sdk","labeling","ai-platform"],"install":[{"cmd":"pip install encord","lang":"bash","label":"Basic Installation"},{"cmd":"pip install encord python-dotenv","lang":"bash","label":"With .env file support"}],"dependencies":[{"reason":"Optional, for loading environment variables from a .env file for authentication.","package":"python-dotenv","optional":true}],"imports":[{"symbol":"EncordUserClient","correct":"from encord.user_client import EncordUserClient"},{"symbol":"StorageLocation","correct":"from encord.orm.dataset import StorageLocation"},{"symbol":"LabelRowV2","correct":"from encord.objects import LabelRowV2"}],"quickstart":{"code":"import os\nfrom encord.user_client import EncordUserClient\n\n# For EMEA clients, use 'ENCORD_KEY'. For US clients, use 'ENCORD_US_KEY'.\n# Replace with your actual private key content or set the environment variable.\n# Example: export ENCORD_KEY=\"-----BEGIN RSA PRIVATE KEY-----\\n...\\n-----END RSA PRIVATE KEY-----\"\nprivate_key = os.environ.get('ENCORD_KEY', os.environ.get('ENCORD_US_KEY', ''))\n\nif not private_key:\n    print(\"Error: Encord private key not found in environment variables (ENCORD_KEY or ENCORD_US_KEY).\")\n    print(\"Please set the environment variable or replace the placeholder in the code.\")\nelse:\n    try:\n        user_client = EncordUserClient.create_with_ssh_private_key(private_key)\n        print(\"Successfully authenticated with Encord.\")\n\n        # Example: List up to 5 datasets accessible by the user\n        datasets = user_client.list_datasets(page_size=5)\n        if datasets:\n            print(\"\\nFirst 5 datasets:\")\n            for ds in datasets:\n                print(f\"  - {ds.title} (ID: {ds.dataset_hash})\")\n        else:\n            print(\"No datasets found.\")\n\n    except Exception as e:\n        print(f\"Authentication or API call failed: {e}\")","lang":"python","description":"Initializes the Encord client using an SSH private key from environment variables (supporting both EMEA and US deployments) and then lists the first 5 accessible datasets. A private key must be generated from the Encord web app and set as an environment variable (ENCORD_KEY or ENCORD_US_KEY)."},"warnings":[{"fix":"Access the Encord platform GUI to manage dataset deletion.","message":"Datasets cannot be deleted via the Python SDK or API; they must be removed directly through the Encord platform web interface.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure a valid CORS policy is applied to your remote storage bucket, allowing Encord's domains. Consult provider-specific documentation for CORS setup (e.g., AWS S3 bucket policy).","message":"When working with remote storage (AWS S3, GCP, Azure), Cross-Origin Resource Sharing (CORS) policies must be correctly configured for images or videos to load properly in the Encord application. Failure to do so will result in loading errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider increasing the timeout setting for your Encord client instance, or break down operations into smaller queries if possible.","message":"Calling `user_client.get_project()` on very large projects can lead to timeouts.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the latest Encord documentation for updated methods or alternatives for accessing label and activity logs.","message":"Some 'Label / Activity logs' functionalities within project management are marked as deprecated.","severity":"deprecated","affected_versions":"Mentioned in current documentation"},{"fix":"Utilize Encord's platform or SDK re-encoding functions to process videos. The platform detects and warns about such issues, offering re-encoding solutions (e.g., dropping audio, re-encoding video frames, converting formats).","message":"Video re-encoding issues (e.g., 'ghost frames' from negative timestamps, unexpected behavior with audio frames, variable frame rates) can cause annotation misalignment.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the missing dependency: `pip install python-dotenv` or `pip install encord python-dotenv`.","cause":"The `python-dotenv` package is not installed, but it is required if you are using a `.env` file for local environment variable management.","error":"ModuleNotFoundError: No module named 'python_dotenv'"},{"fix":"Verify that your SSH private key is correct, unexpired, and properly formatted. Ensure you are using the correct key for your Encord region (EMEA or US) and that it has the necessary permissions.","cause":"The SSH private key used for authentication is either incorrect, malformed, or has expired. The client cannot establish a secure connection.","error":"Authentication or API call failed: Invalid private key provided."},{"fix":"Update the CORS policy for your remote storage bucket to allow access from Encord's domains. Consult your cloud provider's documentation for specific instructions on setting up CORS.","cause":"This error often indicates a misconfigured Cross-Origin Resource Sharing (CORS) policy on your cloud storage bucket (e.g., AWS S3, GCP, Azure), preventing Encord from accessing the media.","error":"Failed to load image/video from remote storage"},{"fix":"Increase the timeout for your Encord client or consider fetching project data in smaller, more manageable queries if the API supports it. Check the Encord documentation for client configuration options related to timeouts.","cause":"This timeout typically occurs when `user_client.get_project()` is called on an exceptionally large project, and the default network timeout is exceeded while fetching project data.","error":"requests.exceptions.ReadTimeout: HTTPConnectionPool(...) Read timed out."}]}