DHI/terracotta

Import error on `from collections import Mapping` when running on Python 3.10

mz8i opened this issue · 2 comments

mz8i commented

When installing from source using conda env create -f environment.yml, I get Python 3.10 installed due to the dependency specifier python>=3.6.

However, running the server and querying /singleband results in errors with message AttributeError: module 'collections' has no attribute 'MutableMapping'

Probably related: https://stackoverflow.com/questions/70195545/module-collections-has-no-attribute-mapping-issue-on-macos-for-sdk-installa

Manually editing environment.yml to specify python==3.9 fixed the problem for me.

Suggestion: move from from collections import Mapping to from collections.abc import Mapping, or mark Python 3.10 as not supported yet

There's still no rasterio wheel for Python 3.10, so support is somewhat experimental. I'll have a look at how things stand with conda. But since we don't use MutableMapping this is likely a dependency issue.

Fixed the Mapping issue, so running on 3.10 via conda should work fine now.