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

Heads up! You've already completed this tutorial.

Mark_Salerno | 2020-12-20 14:05:50 UTC | #1

https://www.pythonguis.com/tutorials/first-steps-qt-creator/

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

python
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


martin | 2020-12-19 18:49:10 UTC | #2

[quote="Mark_Salerno, post:1, topic:629"] https://tinyurl.com/y3dm3h86 [/quote]

Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.

More info Get the book

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?


Mark_Salerno | 2020-12-19 18:49:10 UTC | #3

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


Sergey_Bellov | 2021-01-20 18:34:31 UTC | #4

install numpy==1.19.3 Here is a solution https://youtu.be/0DgOz3hJeC0


Sergey_Bellov | 2021-02-14 15:04:02 UTC | #5

The solution is here: https://youtu.be/0DgOz3hJeC0


Over 10,000 developers have bought Create GUI Applications with Python & Qt!
Create GUI Applications with Python & Qt5
Take a look

Downloadable ebook (PDF, ePub) & Complete Source code

Also available from Leanpub and Amazon Paperback

[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]
Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak

RuntimeError: The current Numpy installation fails to pass a sanity check due to a bug in the windows runtime was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt.