Skip to content

"No module found" when HDX Utilities gets ahead of HDX Country #82

@StuartBertram

Description

@StuartBertram

I just did an update and got hdx-python-utilities v4.0.4, but hdx-python-country stayed on 3.9.8. This then leads to the following stack trace when importing any of the hdx-python-country classes:

../../path/to/myfile.py:10: in <module>
    from hdx.location.country import Country
.venv/lib/python3.14/site-packages/hdx/location/country.py:13: in <module>
    from hdx.utilities.typehint import ExceptionUpperBound
E   ModuleNotFoundError: No module named 'hdx.utilities.typehint'

It looks like hdx-python-country requires hdx-python-utilities >=3.9.2, but doesn't put an upper bound on it. That lets the utilities get ahead of the country package, which results in a mismatch between the pre-Python3.10 code and the newer code that targets Python 3.10.

I don't know whether you're likely to release a new 3.x version for anyone not moving to 4.x to fix it there, but if you expect the versioning to stay consistent then it might be worth putting a "and <5.0" condition on the 4.x branch to avoid this happening in the next big version upgrade.

In the mean time, I'll just change my versions and move to hdx-python-country 4.x (or people can manually specify hdx-python-utilities < 4)

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