Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shapely version >= 2.0 not supported #2855

Closed
MichaelKarpe opened this issue Oct 26, 2023 · 3 comments
Closed

shapely version >= 2.0 not supported #2855

MichaelKarpe opened this issue Oct 26, 2023 · 3 comments
Assignees
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.

Comments

@MichaelKarpe
Copy link

Shapely >= 2.0 has been allowed following #2829 but is not supported, leading to a very similar error to #1852.
Issue is solved by setting shapely < 2.0.

Environment details

  • OS type and version: Windows 11
  • Python version: python --version 3.9.6
  • pip version: pip --version 23.2
  • google-cloud-aiplatform version: pip show google-cloud-aiplatform 1.35.0

Steps to reproduce

  1. pip install google-cloud-aiplatform
  2. from vertexai.language_models import TextEmbeddingModel

Code example

from vertexai.language_models import TextEmbeddingModel

Stack trace

  File "", line 2, in <module>
    from vertexai.language_models import TextEmbeddingModel
  File ".venv\lib\site-packages\vertexai\__init__.py", line 17, in <module>
    from google.cloud.aiplatform import init
  File ".venv\lib\site-packages\google\cloud\aiplatform\__init__.py", line 24, in <module>
    from google.cloud.aiplatform import initializer
  File ".venv\lib\site-packages\google\cloud\aiplatform\initializer.py", line 36, in <module>
    from google.cloud.aiplatform.metadata import metadata
  File ".venv\lib\site-packages\google\cloud\aiplatform\metadata\metadata.py", line 28, in <module>
    from google.cloud.aiplatform import pipeline_jobs
  File ".venv\lib\site-packages\google\cloud\aiplatform\pipeline_jobs.py", line 31, in <module>
    from google.cloud.aiplatform.metadata import artifact
  File ".venv\lib\site-packages\google\cloud\aiplatform\metadata\artifact.py", line 26, in <module>
    from google.cloud.aiplatform import models
  File ".venv\lib\site-packages\google\cloud\aiplatform\models.py", line 47, in <module>
    from google.cloud.aiplatform import jobs
  File ".venv\lib\site-packages\google\cloud\aiplatform\jobs.py", line 28, in <module>
    from google.cloud import bigquery
  File ".venv\lib\site-packages\google\cloud\bigquery\__init__.py", line 35, in <module>
    from google.cloud.bigquery.client import Client
  File ".venv\lib\site-packages\google\cloud\bigquery\client.py", line 74, in <module>
    from google.cloud.bigquery import _pandas_helpers
  File ".venv\lib\site-packages\google\cloud\bigquery\_pandas_helpers.py", line 56, in <module>
    _to_wkb = _to_wkb()
  File ".venv\lib\site-packages\google\cloud\bigquery\_pandas_helpers.py", line 46, in _to_wkb
    from shapely.geos import WKBWriter, lgeos  # type: ignore
ImportError: cannot import name 'WKBWriter' from 'shapely.geos' (.venv\lib\site-packages\shapely\geos.py)
@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label Oct 26, 2023
@ZhenyiQ ZhenyiQ self-assigned this Oct 27, 2023
@nayaknishant
Copy link
Contributor

hi @MichaelKarpe, with https://github.com/googleapis/python-bigquery/releases/tag/v3.13.0 and googleapis/python-bigquery#1696, Shapely >= 2.0 should be supported with the Vertex SDK.

I was able to run the following code snippet locally

! pip3 install --upgrade --force-reinstall google-cloud-aiplatform

import vertexai

from vertexai.language_models import TextEmbeddingModel

Please let us know if you still run into an error.

@irfanhabib
Copy link

irfanhabib commented Jan 15, 2024

I'm getting this exception with version 1.39.0, have to downgrade to 1.35.0 (e76abd3)

@MichaelKarpe
Copy link
Author

MichaelKarpe commented Mar 5, 2024

@nayaknishant sorry for the very late reply, but I was actually asking to enforce the constraint due to a bug and not to relax it. Investigating further, I opened googleapis/python-bigquery#1842 that should solve the issue if addressed.

@irfanhabib this may be of interest for you. You should be able to use the latest google-cloud-aiplatform if you specify shapely<2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants