5

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.

47jeff
  • 53
  • 1
  • 4

2 Answers2

10

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"
tskuzzy
  • 35,812
  • 14
  • 73
  • 140
0

Running into a similiar issue. So far, I am able to tell that google.cloud actions will not run if I have shapley files installed. When I delete the shapley files on my computer I am able to run google.cloud methods

Tyler
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 20 '22 at 09:29