cogeotiff / rio-cogeo

Cloud Optimized GeoTIFF creation and validation plugin for rasterio
https://cogeotiff.github.io/rio-cogeo/
BSD 3-Clause "New" or "Revised" License
308 stars 42 forks source link

installation issues - coggeo command #263

Closed gagecarto closed 1 year ago

gagecarto commented 1 year ago

Having some issues popup with install on Ubuntu 22.04.2 LTS with Python 3.10.6. I have GDAL 3.4.1 installed

gdal-bin is already the newest version (3.4.1+dfsg-1build4).

rio installs but not the cogeo command cogeo † Warning: could not load plugin. Seerio cogeo --help.

rio cogeo --help yields


Warning: entry point could not be loaded. Contact its author for help.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/click_plugins/core.py", line 37, in decorator
    group.add_command(entry_point.load())
  File "/usr/local/lib/python3.10/dist-packages/pkg_resources/__init__.py", line 2518, in load
    return self.resolve()
  File "/usr/local/lib/python3.10/dist-packages/pkg_resources/__init__.py", line 2524, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.10/dist-packages/rio_cogeo/__init__.py", line 5, in <module>
    from .cogeo import cog_info, cog_translate, cog_validate  # noqa
  File "/usr/local/lib/python3.10/dist-packages/rio_cogeo/cogeo.py", line 12, in <module>
    import morecantile
  File "/usr/local/lib/python3.10/dist-packages/morecantile/__init__.py", line 14, in <module>
    from .defaults import TileMatrixSets, tms  # noqa
  File "/usr/local/lib/python3.10/dist-packages/morecantile/defaults.py", line 11, in <module>
    from morecantile.models import TileMatrixSet
  File "/usr/local/lib/python3.10/dist-packages/morecantile/models.py", line 101, in <module>
    class TMSBoundingBox(BaseModel):
  File "/usr/local/lib/python3.10/dist-packages/morecantile/models.py", line 104, in TMSBoundingBox
    type: str = Field("BoundingBoxType", const=True)
  File "/usr/local/lib/python3.10/dist-packages/pydantic/fields.py", line 715, in Field
    raise PydanticUserError('`const` is removed, use `Literal` instead', code='removed-kwargs')
pydantic.errors.PydanticUserError: `const` is removed, use `Literal` instead

For further information visit https://errors.pydantic.dev/2.0.1/u/removed-kwargs```
vincentsarago commented 1 year ago

can you try downgrading pydantic to 1.*

python -m pip install pydantic~=1.0
vincentsarago commented 1 year ago

if you update morecantile to the latest version it would also fix this.

gagecarto commented 1 year ago

The morecantile upgrade did it.. thanks so much