Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The current Numpy installation fails to pass a sanity check due to a bug in the windows runtime [duplicate]

This is the error I am getting and, as far as I can tell, there is nothing useful on the error link to fix this.

RuntimeError: The current Numpy installation ('...\\venv\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.

See this issue for more information: https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html

I have tried multiple versions of Python (3.8.6 and 3.9.0) and numpy and pandas. I am currently using PyCharm to do all this.

like image 898
Reed Collins Avatar asked Nov 02 '20 23:11

Reed Collins


5 Answers

This error occurs when using python3.9 and numpy1.19.4 So uninstalling numpy1.19.4 and installing 1.19.3 will work.


Edit

As of January 5th 2021 numpy version 1.19.5 is out and appears to solve the problem.

like image 156
Śãmiķšha Ŕånjaň Avatar answered Nov 15 '22 20:11

Śãmiķšha Ŕånjaň


I am using Python 3.7, anyway the same solution suggested here helped me.

pip install numpy==1.19.3

Actually the link informed https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html shows the given solution. It seems to be a bug in Visual Studio, which remains unsolved up to this date.

like image 28
Fabio Mendes Soares Avatar answered Nov 15 '22 20:11

Fabio Mendes Soares


Just install numpy==1.19.3 I am using python 3.9

like image 40
Dipesh Paul Avatar answered Nov 15 '22 21:11

Dipesh Paul


As per the discussion on the link you provided, a numpy dev answered:

NumPy has released a bugfix 1.19.3 to work around this issue. The bugfix broke something else on Linux, so we had to revert the fix in release 1.19.4, but you can still install the 1.19.3 via pip install numpy==1.19.3.

So, if you need requirements that work for both Linux and Windows, you'll need to use PEP508:

numpy==1.19.3; platform_system == "Windows"
numpy>=1.19.4; platform_system == "linux"
like image 32
Pierre.Sassoulas Avatar answered Nov 15 '22 20:11

Pierre.Sassoulas


It's a bug of numpy 1.19.4 that fails with all python versions. Use the previous version to solve the problem, so by terminal:

pip install numpy==1.19.3
like image 12
Morgana Avatar answered Nov 15 '22 21:11

Morgana