question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

NOTE: THIS IS NOT A SKYFIELD ISSUE BUT IS REPORTED IN CASE SKYFIELD USERS RUN INTO IT

Background: after months of neglecting my Skyfield application I decided to check if everything still runs on updated versions of Python3 (3.8.3rc1 -> 3.9.0), Skyfield (1.20 -> 1.31), Pandas (1.0.3 -> 1.1.4) and Windows 10 (1909 -> 20H2).

Hardware: new PC based on an AMD Ryzen 7 3700X 8-Core Processor

Following a successful new installation of Python 3 I immediately hit this error, i.e. my code didn’t even start:

D:\_DEVelopment\Astronomical coding\CODE - SFalmanac\_debug_code\0sf-v2d-py3>py -3 sfalmanac.py
 ** 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 "D:\_DEVelopment\Astronomical coding\CODE - SFalmanac\_debug_code\0sf-v2d-py3\sfalmanac.py", line 20, in <module>
    import tables
  File "D:\_DEVelopment\Astronomical coding\CODE - SFalmanac\_debug_code\0sf-v2d-py3\tables.py", line 29, in <module>
    from alma_skyfield import *
  File "D:\_DEVelopment\Astronomical coding\CODE - SFalmanac\_debug_code\0sf-v2d-py3\alma_skyfield.py", line 25, in <module>
    from skyfield.api import Topos, Star, load
  File "C:\Python39\lib\site-packages\skyfield\api.py", line 11, in <module>
    from .constellationlib import load_constellation_map
  File "C:\Python39\lib\site-packages\skyfield\constellationlib.py", line 27, in <module>
    from numpy import searchsorted
  File "C:\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Python39\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Python39\\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://tinyurl.com/y3dm3h86

D:\_DEVelopment\Astronomical coding\CODE - SFalmanac\_debug_code\0sf-v2d-py3>

The link mentioned above goes here: https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html

The problem is apparently a fmod bug when using conda python and OpenBLAS 0.3.9 and the final resolution may be “released near the end of January 2021”.

Workaround 1 is related to using a Windows Subsystem for Linux: https://pbpython.com/wsl-python.html which is irrelevant in my case as I have a dual boot PC with Ubuntu 20.04 LTS (and testing on Windows 10 is intentional).

Workaround 4 may be the most practical one for now - using an older version of NumPy: pip install numpy==1.19.3 (I haven’t experimented with this yet).

Again - my apologies for posting this here - but maybe another workaround can be found for Skyfield? I always welcome constructive feedback 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
aendiecommented, Nov 6, 2020

SUCCESS!

Downgrading the version of NumPy enabled my Skyfield application to run and the output appears to be perfect.

In detail … this was the fix applied:

C:\Python39>pip uninstall numpy
Found existing installation: numpy 1.19.4
Uninstalling numpy-1.19.4:
  Would remove:
    c:\python39\lib\site-packages\numpy-1.19.4.dist-info\*
    c:\python39\lib\site-packages\numpy\*
    c:\python39\scripts\f2py.exe
Proceed (y/n)? y
  Successfully uninstalled numpy-1.19.4

C:\Python39>pip install numpy==1.19.3
Collecting numpy==1.19.3
  Downloading numpy-1.19.3-cp39-cp39-win_amd64.whl (13.3 MB)
     |████████████████████████████████| 13.3 MB 3.2 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.19.3

C:\Python39>
1reaction
aendiecommented, Feb 3, 2021

FINAL STABLE FIX TESTED (and working)

Today I patched my Windows 10 installation with the following Update: 2021-01 Cumulative Update Preview for Windows 10 Version 20H2 for x64-based Systems (KB4598291)

I then tested my software with NumPy version 1.19.4 and it ran perfectly (also with the latest version NumPy 1.20.0) Others in the Microsoft developer community also report positively that this issue is fixed.

Steve Wishnousky (Microsoft) also added this:

This update has started being pushed out to machines today, but this occurs gradually. If you would like to update your machine immediately, you can also get the appropriate .msu from here: https://www.catalog.update.microsoft.com/Search.aspx?q=KB4598291

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: The current NumPy installation fails to pass a ...
python - RuntimeError: The current NumPy installation fails to pass a sanity check due to a bug in the windows runtime - Stack...
Read more >
The current Numpy installation fails to pass a sanity ... - GitHub
A Windows update was applied to our ephys and video pcs last night (2020-11-18), I pulled the latest version of the code this...
Read more >
Numpy install with reticulate fail sanity check - General
Hello, I have a problem when installing numpy with reticulate. Reprex: In a new project, ... RuntimeError: The current Numpy installation ...
Read more >
Numpy installation fails to pass - Visual Studio Feedback
Message=The current Numpy installation ... fails to pass a sanity check due to a bug in the windows runtime. See this issue for...
Read more >
How to fix “runtimeError: package fails to pass a sanity check ...
This error occurs when using python3.9 and numpy1.19.4 So uninstalling numpy1.19.4 and installing 1.19.3 will work. ... As of January 5th 2021 numpy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found