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

Pin shapely>2.0.0 #1101

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Pin shapely>2.0.0 #1101

merged 1 commit into from
Nov 27, 2024

Conversation

weiji14
Copy link
Contributor

@weiji14 weiji14 commented Nov 25, 2024

Changes in #1047 means that import sahi won't work with shapely=1.8 installed due to this line:

from shapely import GeometryCollection, MultiPolygon, Polygon

Full error (copied from conda-forge/sahi-feedstock#60 (comment):

import: 'sahi'
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/sahi_1732418500825/test_tmp/run_test.py", line 2, in <module>
    import sahi
  File "/home/conda/feedstock_root/build_artifacts/sahi_1732418500825/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/sahi/__init__.py", line 3, in <module>
    from sahi.annotation import BoundingBox, Category, Mask
  File "/home/conda/feedstock_root/build_artifacts/sahi_1732418500825/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/sahi/annotation.py", line 9, in <module>
    from sahi.utils.coco import CocoAnnotation, CocoPrediction
  File "/home/conda/feedstock_root/build_artifacts/sahi_1732418500825/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/sahi/utils/coco.py", line 17, in <module>
    from shapely import GeometryCollection, MultiPolygon, Polygon
ImportError: cannot import name 'GeometryCollection' from 'shapely' (/home/conda/feedstock_root/build_artifacts/sahi_1732418500825/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib/python3.7/site-packages/shapely/__init__.py)

Solution is to pin to shapely>2.0.0 as suggested at #1061 (comment)

To fix `ImportError: cannot import name 'GeometryCollection' from 'shapely'`
@fcakyon fcakyon merged commit 7e36595 into obss:main Nov 27, 2024
9 checks passed
@fcakyon
Copy link
Collaborator

fcakyon commented Nov 27, 2024

Thanks a lot for the fix @weiji14 🙏

@weiji14 weiji14 deleted the patch-1 branch November 27, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants