python中numpy包报错 _win_os_check()

报错

Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/NeuralNetworks/NeuralNerwork.py", line 2, in <module>
    import numpy
  File "C:\Users\Administrator\NeuralNetworks\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\Administrator\NeuralNetworks\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:\\Users\\Administrator\\NeuralNetworks\\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

解决方法

在__init__.py中将这一行a = a % 17 注释掉

    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://tinyurl.com/y3dm3h86")
            raise RuntimeError(msg.format(__file__)) from None

猜你喜欢

转载自blog.csdn.net/joey_ro/article/details/111587183