googleapis / python-aiplatform

A Python SDK for Vertex AI, a fully managed, end-to-end platform for data science and machine learning.
Apache License 2.0
604 stars 322 forks source link

Getting AttributeError when importing cloud_profiler from google cloud aiplatform #4079

Open Abe410 opened 1 month ago

Abe410 commented 1 month ago

When running the following:

from google.cloud.aiplatform.training_utils import cloud_profiler

I get:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 from google.cloud.aiplatform.training_utils import cloud_profiler

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/aiplatform/__init__.py:26
     21 __version__ = aiplatform_version.__version__
     24 from google.cloud.aiplatform import initializer
---> 26 from google.cloud.aiplatform.datasets import (
     27     ImageDataset,
     28     TabularDataset,
     29     TextDataset,
     30     TimeSeriesDataset,
     31     VideoDataset,
     32 )
     33 from google.cloud.aiplatform import explain
     34 from google.cloud.aiplatform import gapic

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/aiplatform/datasets/__init__.py:19
      1 # -*- coding: utf-8 -*-
      2 
      3 # Copyright 2020 Google LLC
   (...)
     15 # limitations under the License.
     16 #
     18 from google.cloud.aiplatform.datasets.dataset import _Dataset
---> 19 from google.cloud.aiplatform.datasets.column_names_dataset import _ColumnNamesDataset
     20 from google.cloud.aiplatform.datasets.tabular_dataset import TabularDataset
     21 from google.cloud.aiplatform.datasets.time_series_dataset import TimeSeriesDataset

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/aiplatform/datasets/column_names_dataset.py:24
     21 from typing import List, Optional, Set
     22 from google.auth import credentials as auth_credentials
---> 24 from google.cloud import bigquery
     25 from google.cloud import storage
     27 from google.cloud.aiplatform import utils

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/__init__.py:35
     31 from google.cloud.bigquery import version as bigquery_version
     33 __version__ = bigquery_version.__version__
---> 35 from google.cloud.bigquery.client import Client
     36 from google.cloud.bigquery.dataset import AccessEntry
     37 from google.cloud.bigquery.dataset import Dataset

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/client.py:69
     65     DEFAULT_BQSTORAGE_CLIENT_INFO = None  # type: ignore
     68 from google.cloud.bigquery._http import Connection
---> 69 from google.cloud.bigquery import _job_helpers
     70 from google.cloud.bigquery import _pandas_helpers
     71 from google.cloud.bigquery import _versions_helpers

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/_job_helpers.py:47
     44 import google.api_core.exceptions as core_exceptions
     45 from google.api_core import retry as retries
---> 47 from google.cloud.bigquery import job
     48 import google.cloud.bigquery.query
     49 from google.cloud.bigquery import table

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/job/__init__.py:17
      1 # Copyright 2015 Google LLC
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     15 """Define API Jobs."""
---> 17 from google.cloud.bigquery.job.base import _AsyncJob
     18 from google.cloud.bigquery.job.base import _error_result_to_exception
     19 from google.cloud.bigquery.job.base import _DONE_STATE

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/job/base.py:30
     28 from google.cloud.bigquery import _helpers
     29 from google.cloud.bigquery._helpers import _int_or_none
---> 30 from google.cloud.bigquery.retry import (
     31     DEFAULT_GET_JOB_TIMEOUT,
     32     DEFAULT_RETRY,
     33 )
     36 _DONE_STATE = "DONE"
     37 _STOPPED_REASON = "stopped"

File /opt/micromamba/lib/python3.10/site-packages/google/cloud/bigquery/retry.py:150
    145 DEFAULT_GET_JOB_TIMEOUT = 128
    146 """
    147 Default timeout for Client.get_job().
    148 """
--> 150 POLLING_DEFAULT_VALUE = google.api_core.future.polling.PollingFuture._DEFAULT_VALUE
    151 """
    152 Default value defined in google.api_core.future.polling.PollingFuture.
    153 """

AttributeError: type object 'PollingFuture' has no attribute '_DEFAULT_VALUE'

Running google-cloud-aiplatform==1.57.0

sasha-gitg commented 1 month ago

@Abe410 What version of google-api-core do you have installed?

Abe410 commented 1 month ago

@Abe410 What version of google-api-core do you have installed?

google-api-core==2.8.1