Skip to content

Installation of segment-geospatial fails in Google Colab due to sam2 dependency error #394

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

Closed
Luisafrodriguezo1 opened this issue Mar 21, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Luisafrodriguezo1
Copy link

Environment Information

  • samgeo version: 0.12.4 (as specified in segment-geospatial dependency)
  • Python version: Python 3.11.11 (Google Colab)
  • Operating System: Google Colab

Description

I am trying to install the segment-geospatial package in Google Colab. The installation fails due to an error encountered when building the sam2 dependency. Specifically, the error occurs during the "getting requirements to build wheel" step for sam2. I expected the segment-geospatial package to install successfully, along with its dependencies.

!pip install git+https://github.com/opengeos/segment-geospatial
or
pip install segment-geospatial

# Output:
Collecting segment-geospatial
  Downloading segment_geospatial-0.12.4-py2.py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: fiona in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (1.10.1)
Requirement already satisfied: gdown in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (5.2.0)
Requirement already satisfied: geopandas in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (1.0.1)
Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (0.29.3)
Collecting ipympl (from segment-geospatial)
  Using cached ipympl-0.9.7-py3-none-any.whl.metadata (8.7 kB)
Collecting leafmap (from segment-geospatial)
  Using cached leafmap-0.42.13-py2.py3-none-any.whl.metadata (16 kB)
Collecting localtileserver (from segment-geospatial)
  Using cached localtileserver-0.10.6-py3-none-any.whl.metadata (5.2 kB)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (3.10.0)
Requirement already satisfied: opencv-python-headless in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (4.11.0.86)
Collecting patool (from segment-geospatial)
  Using cached patool-4.0.0-py2.py3-none-any.whl.metadata (4.5 kB)
Requirement already satisfied: pycocotools in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (2.0.8)
Requirement already satisfied: pyproj in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (3.7.1)
Requirement already satisfied: rasterio in /usr/local/lib/python3.11/dist-packages (from segment-geospatial) (1.4.3)
Collecting rioxarray (from segment-geospatial)
  Using cached rioxarray-0.18.2-py3-none-any.whl.metadata (5.4 kB)
Collecting sam2 (from segment-geospatial)
  Using cached sam2-1.1.0.tar.gz (152 kB)
  Installing build dependencies ... done
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
@Luisafrodriguezo1 Luisafrodriguezo1 added the bug Something isn't working label Mar 21, 2025
@giswqs giswqs linked a pull request Mar 25, 2025 that will close this issue
@giswqs
Copy link
Member

giswqs commented Mar 25, 2025

Run pip install -U setuptools before install samgeo. It should work now.

@giswqs giswqs closed this as completed Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants