Install & Compatibility
Where this runs
tested against v2.20.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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.968s · 72.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.6s · import 1.370s · 71MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AutoMlClient
✓ from google.cloud import automl
✗ from google.cloud import automl_v1
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.
import os
from google.cloud import automl_v1
from google.api_core.exceptions import GoogleAPIError
def list_automl_datasets(project_id: str, location: str):
"""Lists all AutoML datasets for a given project and location."""
try:
client = automl_v1.AutoMlClient()
project_location = f"projects/{project_id}/locations/{location}"
print(f"Listing datasets for project '{project_id}' in location '{location}'...")
datasets = client.list_datasets(parent=project_location)
found_datasets = False
for dataset in datasets:
found_datasets = True
print(f"- Dataset name: {dataset.display_name} (ID: {dataset.name.split('/')[-1]})")
print(f" Full Resource Name: {dataset.name}")
print(f" State: {automl_v1.Dataset.State(dataset.example_count_state).name}")
print(f" Creation Time: {dataset.create_time.strftime('%Y-%m-%d %H:%M:%S UTC')}")
if not found_datasets:
print("No datasets found.")
except GoogleAPIError as e:
print(f"An API error occurred: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
if __name__ == "__main__":
project_id = os.environ.get("GOOGLE_CLOUD_PROJECT")
location = os.environ.get("GOOGLE_CLOUD_LOCATION", "us-central1") # Default location
if not project_id:
print("Error: GOOGLE_CLOUD_PROJECT environment variable not set.")
print("Please set it to your Google Cloud project ID.")
else:
list_automl_datasets(project_id, location)
Debug
Known issues
deprecatedGoogle 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.fixInstall `google-cloud-aiplatform` (`pip install google-cloud-aiplatform`) and refer to the Vertex AI SDK documentation for modern AutoML and ML Platform functionalities.
affects: All versions (starting from `2.x.x` as the shift became prominent)
breakingThis 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`.fixUpgrade 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`.
affects: All versions >= 2.7.4
gotchaProper 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.fix1. 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.
affects: All versions
Upgrade
Version history
2.20.1latest on PyPI · released Aug 24, 2026
Audit
Dependencies
No dependency data recorded yet.