Skip to content

Import of collections.Hashable fails in Python 3.10 #79

Open
@PTriebold

Description

@PTriebold

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 12.6
  • Python version: 3.10.7
  • NumPy version: 1.23.3

Describe the current behavior
import of numpy_ml fails due to an ImportError with the collections module.

Describe the expected behavior
Importing just the module should not generate an ImportError

Code to reproduce the issue

# Python 3.10 or newer
import numpy_ml

Other info / logs
In Python 3.10 the deprecated aliases were removed.

Remove deprecated aliases to Collections Abstract Base Classes from the collections module. (Contributed by Victor Stinner in bpo-37324.)

from What’s New In Python 3.10

fix
To fix the bug, in /numpy_ml/utils/data_structures.py change

from collections import Hashable

to

from collections.abc import Hashable

Activity

idanh

idanh commented on Feb 1, 2023

@idanh

@ddbourgin any chance this will be fixed to support python 3.10? Thanks

msf235

msf235 commented on Aug 5, 2023

@msf235

@ddbourgin any chance this will be fixed to support python 3.10? Thanks

I created a pull request #85 to address this.

chiarcos

chiarcos commented on Nov 20, 2023

@chiarcos

Could someone take a look at the pull request, maybe?

remo-help

remo-help commented on Feb 27, 2025

@remo-help

Bumping this issue so PR #85 gets approved. This is necessary for support for Python 3.10+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @idanh@chiarcos@msf235@PTriebold@remo-help

        Issue actions

          Import of collections.Hashable fails in Python 3.10 · Issue #79 · ddbourgin/numpy-ml