Search code examples
pythongoogle-cloud-platformgoogle-ai-platform

cannot import name 'WKBWriter' from 'shapely.geos' when import google cloud ai platform


When I run this code on google colab.

from google.cloud import aiplatform

The following error occurred

ImportError: cannot import name 'WKBWriter' from 'shapely.geos' (/usr/local/lib/python3.8/dist-packages/shapely/geos.py)

Does anyone know how to solve this problem?

I was working fine on 2022/12/16, but today it is not working.


Solution

  • The bug is tracked in: https://github.com/googleapis/python-aiplatform/issues/1852

    The workaround is to pin shapely < 2.0.0

    pip install -U google-cloud-aiplatform "shapely<2"