How do you fix “runtimeError: package fails to pass a sanity check” for numpy and pandas?

后端 未结 8 913
[愿得一人]
[愿得一人] 2020-11-22 05:40

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 installa

相关标签:
8条回答
  • 2020-11-22 05:58

    Rolling back to numpy 1.19.3 worked for me on python 3.8.6

    0 讨论(0)
  • 2020-11-22 06:02

    Why hasn't anyone posted the difference between 1.19.3 and 1.19.4.

    The problematic numpy init code is:

    def _win_os_check():
        """
        Quick Sanity check for Windows OS: look for fmod bug issue 16744.
        """
        try:
            a = arange(13 * 13, dtype= float64).reshape(13, 13)
            a = a % 17  # calls fmod
            linalg.eig(a)
        except Exception:
            msg = ("The current Numpy installation ({!r}) 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")
            raise RuntimeError(msg.format(__file__)) from None
    
    if sys.platform == "win32" and sys.maxsize > 2**32:
        _win_os_check()
    
    del _win_os_check
    

    This code section doesn't exist in 1.19.3; that's the only difference.

    0 讨论(0)
  • 2020-11-22 06:05

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

    0 讨论(0)
  • 2020-11-22 06:05

    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.

    0 讨论(0)
  • 2020-11-22 06:05

    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
    
    0 讨论(0)
  • 2020-11-22 06:18

    Just install numpy==1.19.3 I am using python 3.9

    0 讨论(0)
提交回复
热议问题