Skip to content

Ray is not installed via google-cloud-aiplatform[ray] on 3.12 #5252

@insomnes

Description

@insomnes

After the recent addition of vertex ai operators to Apache Airflow there are problems now with tests on only python 3.12, because ray extra is not installed for 3.12.

I suppose the main problem is that ray extra of google-cloud-aiplatform has ray[default] options for ==3.11 and <3.11, so it's not installing ray on > 3.11:

https://github.com/googleapis/python-aiplatform/blob/main/setup.py#L103C1-L103C18

Environment details

  • OS type and version: Linux
  • Python version: Python 3.12.7
  • pip version:
  • google-cloud-aiplatform version: 1.73.0, also checked on 1.80.0, 1.90.0

Steps to reproduce

  1. Python 3.12 environment
  2. Install google-cloud-aiplatform[ray]
  3. Try to import anything with ray import like from google.cloud.aiplatform.vertex_ray.util import resources
docker run -it --rm python:3.12 /bin/bash -c 'pip install google-cloud-aiplatform[ray] && python -c "from google.cloud.aiplatform.vertex_ray.util import resources"'

Compare it to 3.11:

docker run -it --rm python:3.11 /bin/bash -c 'pip install google-cloud-aiplatform[ray] && python -c "from google.cloud.aiplatform.vertex_ray.util import resources"'

Code example

from google.cloud.aiplatform.vertex_ray.util import resources

Stack trace

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.12/site-packages/google/cloud/aiplatform/vertex_ray/__init__.py", line 21, in <module>
    from google.cloud.aiplatform.vertex_ray.bigquery_datasource import (
  File "/usr/local/lib/python3.12/site-packages/google/cloud/aiplatform/vertex_ray/bigquery_datasource.py", line 27, in <module>
    from ray.data.block import Block
ModuleNotFoundError: No module named 'ray'

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions