Skip to content

AttributeError: module 'gdal2tiles' has no attribute 'generate_tiles'  #2

@ashnair1

Description

@ashnair1

When I run the command geolabels make_all raster/ tiles/ categories.json

I get this error after labels are made. AttributeError: module 'gdal2tiles' has no attribute 'generate_tiles'

I've narrowed down to the cause but don't know how to fix it.

Not sure about the lower versions but on 3.1.4 (and probably up), GDAL has a gdal2tiles.py and this creates a conflict.
So when I run the command it imports gdal2tiles from here

'/home/ashwin/miniconda3/envs/rdet/lib/python3.7/site-packages/GDAL-3.1.4-py3.7-linux-x86_64.egg-info/scripts/gdal2tiles.py'

instead of here

/home/ashwin/miniconda3/envs/rdet/lib/python3.7/site-packages/gdal2tiles/gdal2tiles.py

The one from GDAL does not have a generate_tiles function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions