Skip to content

module 'numpy' has no attribute 'typing'. #31564

@roystgnr

Description

@roystgnr

Bug Description

Running MOOSE tests on Ubuntu 24.04 LTS, I get errors like:

controls/web_server_control.control/bool:     def setControllableMatrix(self, path: str, value: np.typing.ArrayLike):
controls/web_server_control.control/bool:                                                       ^^^^^^^^^
controls/web_server_control.control/bool:   File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 333, in __getattr__
controls/web_server_control.control/bool:     raise AttributeError("module {!r} has no attribute "
controls/web_server_control.control/bool: AttributeError: module 'numpy' has no attribute 'typing'. Did you mean: '_typing'?

Adding import numpy.typing as npt and using npt for it in MooseControl.py fixes this for me.

Steps to Reproduce

run_tests is sufficient for me; I'm not sure what combination of python libraries is responsible for that.

Impact

False positive test failures from other people's code are making it hard for me to investigate true test failures from my code!

[Optional] Diagnostics

No response

Metadata

Metadata

Assignees

Labels

P: normalA defect affecting operation with a low possibility of significant effects.T: defectAn anomaly, which is anything that deviates from expectations.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions