본문 바로가기
python

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

by 맑은안개 2020. 12. 20.
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python\Python39\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
    from . import cbook, rcsetup
  File "C:\Python\Python39\lib\site-packages\matplotlib\cbook\__init__.py", line 28, in <module>
    import numpy as np
  File "C:\Python\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Python\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:\\Python\\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
>>> 

matplotlib 를 import 하는 과정에서 위와 같은 에러가 발생했다.

원인은 numpy 1.19.4 버전에 버그문제가 있어 발생한 것인데 버그가 해결되어 릴리즈된 1.19.3 으로 다운그레이드 하면 해결 된다. ( Python 버전에는 영향이 없다. )

 

설치된 numpy 버전 확인 방법

C:\>pip freeze
astroid==2.4.2
certifi==2020.12.5
chardet==4.0.0
colorama==0.4.4
cycler==0.10.0
idna==2.10
isort==5.6.4
kiwisolver==1.3.1
lazy-object-proxy==1.4.3
matplotlib==3.3.3
mccabe==0.6.1
numpy==1.19.4
Pillow==8.0.1
pylint==2.6.0
pyparsing==2.4.7
python-dateutil==2.8.1
requests==2.25.1
six==1.15.0
toml==0.10.2
urllib3==1.26.2
wrapt==1.12.1

다운그레이드

C:\>pip install numpy==1.19.3

pip freeze 로 다운그레이드 확인

반응형