When trying to load a module from message-ix-models, the following error occurs (see below)
Traceback (most recent call last):
File "test_globiom.py", line 3, in <module>
from message_data.tools.utilities import (
File "c:\repo\message_data_pr\message_data\tools\__init__.py", line 5, in <module>
import message_ix_models.util
File "c:\repo\message-ix-models\message_ix_models\__init__.py", line 5, in <module>
from message_ix_models.util._logging import setup as setup_logging
File "c:\repo\message-ix-models\message_ix_models\util\__init__.py", line 13, in <module>
from .common import (
File "c:\repo\message-ix-models\message_ix_models\util\common.py", line 78, in <module>
class MappingAdapter(Adapter):
File "c:\repo\message-ix-models\message_ix_models\util\common.py", line 102, in MappingAdapter
def __init__(self, maps: Mapping[str, Sequence[Tuple[str, str]]]):
TypeError: 'ABCMeta' object is not subscriptable
Searching online provides the following solution:
"You should use typing.Mapping instead of collections.abc.Mapping. typing contains many generic versions of various types, which are designed to be used in type hints. According to the mypy documentation, there are some differences between the typing classes and the collections.abc classes, but they're unclear on exactly what those differences are."
Changing to the use of typing.Mapping has resolved the above issue, but no further tests were carried out to see if everything else works as required.
When trying to load a module from message-ix-models, the following error occurs (see below)
Searching online provides the following solution:
"You should use typing.Mapping instead of collections.abc.Mapping. typing contains many generic versions of various types, which are designed to be used in type hints. According to the mypy documentation, there are some differences between the typing classes and the collections.abc classes, but they're unclear on exactly what those differences are."
Changing to the use of
typing.Mapping
has resolved the above issue, but no further tests were carried out to see if everything else works as required.FYI: