RuntimeError: The current Numpy installation fails to pass a sanity check due to a bug in the windows runtime

Hello I tried to run the basic first example I get this error

from pyqtgraph import PlotWidget
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    from pyqtgraph import PlotWidget
  File "C:\Users\Roberta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pyqtgraph\__init__.py", line 19, in <module>
    import numpy  ## pyqtgraph requires numpy
  File "C:\Users\Roberta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\Roberta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\Roberta\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\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://tinyurl.com/y3dm3h86
>>> 

I reinstalled numpy and pyqtgraph. Can you give me some ideas to resolve this issue

Mark

This is unfortunately a bug in Windows which will require a fix from Microsoft. The issue is affecting all numpy installations – the bug is tracked on the link at the bottom. Further down that page you can see this list of possible solutions. These are –

  1. Python in WSL . This is a no go for PyQt5, as you can’t expose WSL GUIs.
  2. conda + MKL BLAS using conda create -n mkl python numpy. Although this requires you to use conda.
  3. conda + OpenBLAS 0.3.12 . (same really)
  4. Use 1.19.3 Install with pip install numpy==1.19.3

The only option seems to be either switching to conda for your Python packages, or downgrading to numpy. Note that it says on the link page that you can see encounter the issue on numpy 1.19.3 if you’re using SciPy linear algebra routines.

Does that help at all?

Martin
Yes that worked. I actually found the fix and went to post it and saw you just answered.
I really appreciate the time that you take to fully explain the answers.

I first ran pip uninstall numpy
then I ran pip install numpy==1.19.3

I was able to graph after that.

Mark

install numpy==1.19.3
Here is a solution