Skip to content

pip install failed because numpy2.0 release includes breaking changes #2257

@hongjic

Description

@hongjic

pip install failed because numpy2.0 release includes breaking changes.
all new installs of coremltools should be breaking now.

probably should limit numpy dependency <2.0.0

Stack Trace

coremltools/converters/mil/mil/types/type_mapping.py", line 423, in numpy_type_to_builtin_type
    if np.issubclass_(type(nptype), np.dtype):
..
venv/lib/python3.9/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.issubclass_` was removed in the NumPy 2.0 release. Use `issubclass` builtin instead.

as an example.

To Reproduce

pip install coremltools in a new environment (which will install numpy2.0). do model conversion and shows the above error

System environment (please complete the following information):

  • coremltools version: 8.0b1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected behaviour that should be corrected (type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions