Skip to content

NumPy 2.0 support (AttributeError: "itemset") #21577

@jwnimmer-tri

Description

@jwnimmer-tri

Is your feature request related to a problem? Please describe.

NumPy 2.0 has been released. See https://numpy.org/devdocs/numpy_2_0_migration_guide.html.

Currently, importing certain pydrake versions crashes with this error:

AttributeError: `itemset` was removed from the ndarray class in NumPy 2.0.

Known to fail:

  • stable releases 1.30 and earlier
  • nightly builds 0.0.20240618 and earlier

Describe the solution you'd like

Drake should be compatible with both NumPy 1.x and 2.x.

Describe alternatives you've considered

In the meantime, pydrake users should depend on numpy < 2 in their requirements file.

Alternatively, you can use a nightly build (which itself depends on numpy < 2).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions