I solved it by doing the following steps:-
-
I updated the pyproject.toml(This file contains all the library/dependency/dev dependency)with the numpy version that I installed using
pip install numpycommand.

-
Run
poetry lockto update poetry.lock file(contains details information about the library)

-
Run
poetry installagain, & it should work fine.
- In a nutshell, you just have to install the correct version of numpy Click me to check the compatibility
- And then install the required version using
pip install numpy==version.
Example:
To install NumPy version 1.23.5, use the following-
pip install numpy==1.23.5
If you are having any problems, you can comment.
I`ll try to answer it.