Search code examples
pythonnumpypycharmwindows-10runtime-error

Why does pycharm gives error for importing numpy


In pycharm, when i try to import numpy , i get a runtime error like this.

    Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\deneme\main.py", line 1, in <module>
    import numpy as np
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\user\AppData\Local\Programs\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:\\Users\\user\\AppData\\Local\\Programs\\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 Process finished with exit code 1

I have searched the internet, there is a solution says "install 1.19.3" I have tried to install version 1.19.3 but pycharm still gives error.


Solution

  • try installing this version :

    python -m pip install numpy==1.19.3
    

    From this Microsoft thread fix will be available around January 2021. Thanks.