0

I recently updated my OS(windows 10) to its latest version, now when I run my code it gives me a error

heres a snippet of the code:

import pandas as pd

data1 = pd.read_csv('data1.csv')
data2 = pd.read_csv('data2.csv')

heres the error it gives me:

"C:\Users\win 10\AppData\Local\Programs\Python\Python38\python.exe" F:/PyCharm/pythonProject15/main.py
Traceback (most recent call last):
  File "F:/PyCharm/pythonProject15/main.py", line 1, in <module>
    import pandas 
  File "C:\Users\win 10\AppData\Roaming\Python\Python38\site-packages\pandas\__init__.py", line 11, in <module>
    __import__(dependency)
  File "C:\Users\win 10\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\win 10\AppData\Local\Programs\Python\Python38\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\\win 10\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.

How to fix this, I tried to reinstall pandas but it still gave the error

Ibrahim
  • 798
  • 6
  • 26

1 Answers1

0

there is currently a bug with numpy version 1.19.4 on windows that causes this issue. you can rollback numpy to version 1.19.3 and that should fix it.

type the following command into terminal and it should work.

pip install numpy==1.19.3
AmberLife
  • 46
  • 4