ImportError: cannot import name 'GeometryCollection' from 'shapely' (/opt/conda/lib/python3.10/site-packages/shapely/__init__.py) #1061
-
If I install roboflow with pip first, I encounter this situation. ImportError Traceback (most recent call last) File /opt/conda/lib/python3.10/site-packages/sahi/init.py:3 File /opt/conda/lib/python3.10/site-packages/sahi/annotation.py:9 File /opt/conda/lib/python3.10/site-packages/sahi/utils/coco.py:17 ImportError: cannot import name 'GeometryCollection' from 'shapely' (/opt/conda/lib/python3.10/site-packages/shapely/init.py) from https://github.com/shapely/shapely current shapely/__init__py :from shapely.lib import GEOSException # NOQA from shapely.geometry import ( # NOQA from shapely import _version version = _version.get_versions()["version"] setup_signal_checks() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @atutuncuogluu. Are you sure your shapely version is shapely>=1.8.0? |
Beta Was this translation helpful? Give feedback.
-
Hi, I also encountered this error using shapely 1.8.2. Shapely 1.8.2 does not import GeometryCollection in the init.py file here: https://github.com/shapely/shapely/blob/1.8.2/shapely/__init__.py But shapely 2.0 does: https://github.com/shapely/shapely/blob/2.0.0/shapely/__init__.py So after updating to 2.0, it's fine for me. But you guys should fix the requirements.txt. |
Beta Was this translation helpful? Give feedback.
When I installed some libraries first, I was getting an error because pip made a version correction. When I changed the order of installing the libraries, my problem was solved.