{"id":295,"library":"google-api-core","title":"Google API Core","description":"Google API Core is a foundational library for Python clients of Google APIs, providing essential features like authentication, request handling, and response parsing. The current version is 2.30.0, released on February 17, 2026. The library maintains a regular release cadence, ensuring compatibility and feature enhancements.","status":"active","version":"2.30.0","language":"python","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python","tags":["Google API","Python","Client Library"],"install":[{"cmd":"pip install google-api-core","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for protocol buffer support","package":"protobuf","optional":false},{"reason":"Required for gRPC support","package":"grpcio","optional":true}],"imports":[{"note":"Direct import may lead to ImportError; use the correct import statement.","wrong":"import google.api_core.exceptions","symbol":"google.api_core.exceptions","correct":"from google.api_core import exceptions"},{"note":"Direct import may lead to ImportError; use the correct import statement.","wrong":"import google.api_core.retry","symbol":"google.api_core.retry","correct":"from google.api_core import retry"}],"quickstart":{"code":"from google.api_core import exceptions\n\ntry:\n    # Your code that interacts with Google APIs\n    pass\nexcept exceptions.GoogleAPICallError as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"Basic usage of google-api-core to handle exceptions when interacting with Google APIs."},"warnings":[{"fix":"Upgrade your Python environment to Python 3.10 or higher.","message":"Python 3.9 is no longer actively supported for future updates by google-api-core. While it might still function, it is recommended to upgrade to Python 3.10 or higher for continued support and updates.","severity":"gotcha","affected_versions":"2.30.0 and above"},{"fix":"Ensure that protobuf version 4.25.8 or higher is installed.","message":"The minimum required version of protobuf has been updated to 4.25.8.","severity":"breaking","affected_versions":"2.30.0 and above"},{"fix":"Use the correct import statement: from google.api_core import exceptions.","message":"Direct imports from submodules like google.api_core.exceptions may lead to ImportError.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the latest documentation to identify and replace deprecated methods.","message":"Using deprecated methods may lead to unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"It is recommended to use a virtual environment or use the --root-user-action option if you understand the risks and want to suppress this warning.","message":"Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, potentially rendering your system unusable.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T12:54:35.738Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure `google-api-core` and its associated Google Cloud client libraries are correctly installed. It often helps to upgrade related packages as well.\n\n```bash\npip install --upgrade google-api-core google-cloud-core google-api-python-client\n```","cause":"This error occurs when the `google-api-core` library, or one of its dependencies, is not installed in the Python environment, or there's an issue with the Python path preventing the interpreter from finding the module.","error":"ModuleNotFoundError: No module named 'google.api_core'"},{"fix":"Upgrade the `google-api-core` library to a compatible version with your Google Cloud client libraries. Pinning the version of `google-api-core` or the specific client library might be necessary to avoid future conflicts.\n\n```bash\npip install --upgrade google-api-core\n# If a specific version is required:\npip install google-api-core==<compatible_version>\n```","cause":"This error typically arises from a version conflict where an older version of `google-api-core` is being used with a newer Google Cloud client library that expects the `gapic_v1` module or structure, which was introduced or changed in later versions of `google-api-core`.","error":"AttributeError: module 'google.api_core' has no attribute 'gapic_v1'"},{"fix":"Verify that the service account or user credentials have the correct IAM roles assigned for the resource they are trying to access, and that the Python script explicitly requests the necessary OAuth scopes during authentication.\n\n```python\nfrom google.cloud import storage\n# Example with explicit scopes for a client (if using service account JSON)\n# Or ensure your service account has roles like 'Storage Object Viewer' or 'Storage Object Admin'\nclient = storage.Client()\n# ... your code ...\n```","cause":"This exception indicates that the authenticated principal (service account or user) attempting to make the API call lacks the necessary IAM permissions or the required OAuth scopes to access the requested resource or perform the operation.","error":"google.api_core.exceptions.PermissionDenied: 403 Request had insufficient authentication scopes"},{"fix":"Check your network connectivity, firewall rules, and DNS settings to ensure that outbound connections to Google API endpoints (e.g., `googleapis.com` on port 443) are allowed. Temporarily reducing the number of concurrent requests or retrying with exponential backoff can also help if the issue is intermittent service unavailability.","cause":"This error signifies a connectivity problem where the client cannot establish a connection to the Google API endpoint. This can be caused by network issues, firewall restrictions, incorrect DNS resolution, or the target service being temporarily unavailable.","error":"google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"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":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.29,"mem_mb":7.6,"disk_size":"46.1M"},{"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":0.15,"mem_mb":6.4,"disk_size":"47M"},{"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":0.69,"mem_mb":8.3,"disk_size":"49.9M"},{"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":0.21,"mem_mb":7.1,"disk_size":"51M"},{"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":0.6,"mem_mb":8.8,"disk_size":"41.4M"},{"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":0.26,"mem_mb":7.6,"disk_size":"42M"},{"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":0.8,"mem_mb":9.2,"disk_size":"41.1M"},{"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":0.29,"mem_mb":8,"disk_size":"42M"},{"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":0.2,"mem_mb":7.5,"disk_size":"46.1M"},{"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":0.14,"mem_mb":6.3,"disk_size":"47M"}]},"quickstart_checks":{"last_tested":"2026-04-23","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}]}}