0

I made a python program that reads data from file, computes it and then makes a graph from the data using matplotlib. Then I use pyinstaller --onefile plk.py. When I open the program on my PC it works fine but when I transfer it to another computer it throws an error:

    ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "plk.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\matplotlib\__init__.py", line 138, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\matplotlib\cbook\__init__.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\numpy\__init__.py", line 305, in <module>
  File "site-packages\numpy\__init__.py", line 302, in _win_os_check
RuntimeError: The current Numpy installation ('C:\\Users\\zz\\AppData\\Local\\Temp\\_MEI86922\\numpy\\__init__.pyc') 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
[5488] Failed to execute script plk

Does anyone know the solution?

kratos
  • 3
  • 2
  • 2
    Does this answer your question? [How do you fix "runtimeError: package fails to pass a sanity check" for numpy and pandas?](https://stackoverflow.com/questions/64654805/how-do-you-fix-runtimeerror-package-fails-to-pass-a-sanity-check-for-numpy-an) – David Buck Nov 10 '20 at 18:51

2 Answers2

1

Seems like the problem is being tracked in the thread linked in the error message you provided, which is all the information anyone is likely to have.

A documented workaround is to depend on a specific version of numpy, namely numpy==1.19.3 precisely (they added the workaround in 1.19.3, and removed it in 1.19.4 because it broke other stuff on Linux).

Aside from that, you'll just have to watch the thread; it claims a proper fix will likely arrive around January 2021.

ShadowRanger
  • 143,180
  • 12
  • 188
  • 271
  • Downgrading `numpy` to version `1.19.3` worked! It seems that is the only option for now. Thanks! – kratos Nov 10 '20 at 17:03
0

I cannot add a comment because of my reputation. But I did investigate and found this.

Unfortunately it seems to be an error that needs to be patched through a Windows update because it has to do with the Intel and AMD processors. ETA is Jan 2021 according to Steve (click the link I embedded to view his comment).

sumguy37
  • 43
  • 7
  • 1
    I did as ShadowRanger said, and downgraded `numpy` to version `1.19.3` and it seems to work for now. – kratos Nov 10 '20 at 17:04
  • It's not an issue with the processors per se, it's a problem with the Windows runtime's implementation of `fmod` and `remainder`, and the runtime is updated in line with the rest of Windows. – ShadowRanger Nov 10 '20 at 17:05