Resolve warning "A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy"?
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs
--
Chapters
00:00 Question
01:13 Accepted answer (Score 5)
01:47 Answer 2 (Score 7)
02:38 Answer 3 (Score 0)
03:44 Thank you
--
Full question
https://stackoverflow.com/questions/7307...
Question links:
[SciPy's documentation]: https://docs.scipy.org/doc/scipy/dev/too...
Accepted answer links:
https://scipy.github.io/devdocs/dev/tool...
Answer 2 links:
[scipy 1.7.3 docs]: https://docs.scipy.org/doc/scipy/dev/too...
[setup.py]: https://github.com/scipy/scipy/blob/59e6...
[__init__.py]: https://github.com/scipy/scipy/blob/59e6...
Answer 3 links:
[conda]: https://docs.conda.io/projects/conda/en/...
[pip]: https://packaging.python.org/en/latest/t...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #numpy #scipy #conda
#avk47
ACCEPTED ANSWER
Score 10
According to the setup.py file of the scipy 1.7.3, numpy is indeed <1.23.0. As @Libra said, the docs must be incorrect. You can:
- Ignore this warning
- Use scipy 1.8
- Use numpy < 1.23.0
Edit:
This is now fixed in the dev docs of scipy https://scipy.github.io/devdocs/dev/toolchain.html
ANSWER 2
Score 7
I have the same issue.
The scipy 1.7.3 docs specifies
1.16.5 <= numpy <1.24.0 while in scipy 1.7.3 code setup.py and __init__.py we have np_maxversion = '1.23.0'.
As I rely on conda channel defaults to setup Intel MKL libraries for numpy and scipy I decided to pin "numpy>=1.22.3,<1.23.0" until a newer scipy is release on conda channel defaults:
conda create -n myenv python "numpy>=1.22.3,<1.23.0" scipy
ANSWER 3
Score 5
Since "UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required", you can update the numpy version with the specified range to remove the warning.
According to syntax guidelines of conda and pip, updating your numpy version by
conda install "numpy>=1.16.5,<1.23.0"
or
pip install "numpy>=1.16.5,<1.23.0"
inside your environment will work.
Your numpy will be overwritten by the best-match version (1.22.4) in the specified range. You can double-check the new numpy version by:
conda list numpy
or
pip show numpy
ANSWER 4
Score 0
For my similar problem pip install "numpy>=1.16.5,<1.23.0" That works too.