{"id":637,"library":"google-cloud-automl","title":"Google Cloud AutoML Client Library","description":"The `google-cloud-automl` Python client library provides programmatic access to the Google Cloud AutoML API, enabling developers to train high-quality machine learning models tailored to specific business needs without extensive ML expertise. It leverages Google's state-of-the-art transfer learning and Neural Architecture Search technology. Currently at version 2.18.1, the library follows a frequent release cadence, typical of Google Cloud client libraries, with new versions often published weekly or bi-weekly. While functional, Google strongly recommends migrating to the Vertex AI SDK (`google-cloud-aiplatform`) for new development, as Vertex AI represents the next generation of Google's AI platform with enhanced features and MLOps capabilities.","status":"active","version":"2.18.1","language":"python","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-automl","tags":["google-cloud","automl","machine-learning","ai","vertex-ai"],"install":[{"cmd":"pip install google-cloud-automl","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"AutoMlClient","correct":"from google.cloud import automl_v1\nclient = automl_v1.AutoMlClient()"}],"quickstart":{"code":"import os\nfrom google.cloud import automl_v1\nfrom google.api_core.exceptions import GoogleAPIError\n\ndef list_automl_datasets(project_id: str, location: str):\n    \"\"\"Lists all AutoML datasets for a given project and location.\"\"\"\n    try:\n        client = automl_v1.AutoMlClient()\n        project_location = f\"projects/{project_id}/locations/{location}\"\n        \n        print(f\"Listing datasets for project '{project_id}' in location '{location}'...\")\n        datasets = client.list_datasets(parent=project_location)\n        \n        found_datasets = False\n        for dataset in datasets:\n            found_datasets = True\n            print(f\"- Dataset name: {dataset.display_name} (ID: {dataset.name.split('/')[-1]})\")\n            print(f\"  Full Resource Name: {dataset.name}\")\n            print(f\"  State: {automl_v1.Dataset.State(dataset.example_count_state).name}\")\n            print(f\"  Creation Time: {dataset.create_time.strftime('%Y-%m-%d %H:%M:%S UTC')}\")\n\n        if not found_datasets:\n            print(\"No datasets found.\")\n\n    except GoogleAPIError as e:\n        print(f\"An API error occurred: {e}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    project_id = os.environ.get(\"GOOGLE_CLOUD_PROJECT\")\n    location = os.environ.get(\"GOOGLE_CLOUD_LOCATION\", \"us-central1\") # Default location\n\n    if not project_id:\n        print(\"Error: GOOGLE_CLOUD_PROJECT environment variable not set.\")\n        print(\"Please set it to your Google Cloud project ID.\")\n    else:\n        list_automl_datasets(project_id, location)\n","lang":"python","description":"This quickstart demonstrates how to list existing AutoML datasets in a specified Google Cloud project and location. Ensure your `GOOGLE_CLOUD_PROJECT` environment variable is set to your project ID, and `GOOGLE_CLOUD_LOCATION` (defaulting to `us-central1`) is set to the desired region. You must also have the AutoML API enabled and appropriate IAM permissions (e.g., `roles/automl.viewer` or `roles/automl.editor`) for your authenticated service account."},"warnings":[{"fix":"Install `google-cloud-aiplatform` (`pip install google-cloud-aiplatform`) and refer to the Vertex AI SDK documentation for modern AutoML and ML Platform functionalities.","message":"Google strongly recommends migrating to the Vertex AI SDK for Python (`google-cloud-aiplatform`) for new machine learning development. The `google-cloud-automl` library primarily targets an older generation of AutoML tools. While this library remains functional, future feature development, enhanced capabilities, and the best user experience are focused within Vertex AI.","severity":"deprecated","affected_versions":"All versions (starting from `2.x.x` as the shift became prominent)"},{"fix":"Upgrade your Python environment to 3.7 or newer. If you must use Python 3.6, explicitly pin your dependency to `google-cloud-automl==2.7.3`.","message":"This library requires Python >= 3.7. Versions prior to 3.7 are not supported. Specifically, the last version compatible with Python 3.6 is `google-cloud-automl==2.7.3`, and Python 2.7 support ended with `google-cloud-automl==1.0.1`.","severity":"breaking","affected_versions":"All versions >= 2.7.4"},{"fix":"1. Ensure the Google Cloud AutoML API is enabled in your project. 2. Create a Google Cloud service account with at least the `AutoML Editor` role. 3. Download the JSON key file for the service account. 4. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the absolute path of this JSON key file (e.g., `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-service-account-key.json`). 5. Set `GOOGLE_CLOUD_PROJECT` to your project ID.","message":"Proper authentication and IAM permissions are crucial for interacting with the AutoML API. Common issues include the AutoML API not being enabled in the Google Cloud project, an incorrect service account lacking necessary roles (e.g., `roles/automl.editor`), or the `GOOGLE_APPLICATION_CREDENTIALS` environment variable not being correctly set to point to your service account key file. This is especially prone to error in non-standard execution environments like Jupyter notebooks.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T17:04:33.772Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install or upgrade the library using pip: `pip install --upgrade google-cloud-automl`. Ensure you are running this command in the correct virtual environment if you are using one.","cause":"This error occurs when the `google-cloud-automl` Python client library, or a required sub-module like `automl_v1beta1`, is not installed or accessible in your current Python environment.","error":"ModuleNotFoundError: No module named 'google.cloud.automl_v1beta1'"},{"fix":"Ensure the `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the path of a valid service account key JSON file, and that the associated service account has the `AutoML Editor` IAM role or equivalent permissions.","cause":"This indicates an issue with authentication to Google Cloud, such as missing or expired credentials, incorrect service account setup, or insufficient IAM permissions for the AutoML API.","error":"Request had invalid authentication credentials."},{"fix":"For new development, migrate to the Vertex AI SDK (`google-cloud-aiplatform`) to leverage enhanced features and MLOps capabilities, as recommended by Google.","cause":"This is a deprecation warning indicating that the Google Cloud AutoML API and its client library are being phased out in favor of Google Cloud's next-generation AI platform, Vertex AI.","error":"The AutoML API is deprecated. Planned removal date is September 30, 2025."},{"fix":"Upgrade the `google-cloud-automl` library to the latest version: `pip install --upgrade google-cloud-automl`. This ensures you have the most up-to-date API definitions and features.","cause":"This error typically arises from an incompatibility between the installed `google-cloud-automl` library version and the parameters used for dataset creation, or from using an outdated library version.","error":"ValueError: Protocol message Dataset has no \"tables_dataset_metadata\" field."}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"2.19.0","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.84,"mem_mb":26.5,"disk_size":"71.9M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.76,"mem_mb":26.7,"disk_size":"70.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":6.1,"import_time_s":1.04,"mem_mb":21.9,"disk_size":"70M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.02,"mem_mb":22.1,"disk_size":"68M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":2.47,"mem_mb":28.4,"disk_size":"76.9M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.72,"mem_mb":28.7,"disk_size":"75.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":5.2,"import_time_s":1.65,"mem_mb":24.1,"disk_size":"75M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.61,"mem_mb":24.4,"disk_size":"73M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":2.43,"mem_mb":28.2,"disk_size":"68.3M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.67,"mem_mb":28.4,"disk_size":"67.1M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.4,"import_time_s":1.9,"mem_mb":23.4,"disk_size":"66M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.03,"mem_mb":24.2,"disk_size":"65M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":2.28,"mem_mb":28.7,"disk_size":"67.9M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.7,"mem_mb":29.2,"disk_size":"66.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.7,"import_time_s":1.81,"mem_mb":24.3,"disk_size":"66M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.18,"mem_mb":24.8,"disk_size":"64M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":1.7,"mem_mb":26.4,"disk_size":"71.9M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.6,"mem_mb":26.3,"disk_size":"70.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":7.1,"import_time_s":1.29,"mem_mb":21.8,"disk_size":"70M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.12,"mem_mb":21.7,"disk_size":"69M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}