7

Previously I was unable to install libraries in pycharm. Then I changed the system interpreter to 'C:\Users\hp\AppData\Local\Programs\Python\Python37\python' and then created the project in that environment. Then I was able to install numpy library. But when I tried to run the project it gives me the following error.

C:\Users\hp\AppData\Local\Programs\Python\Python37\python.exe C:/Users/hp/PycharmProjects/K_2/T1.py
Traceback (most recent call last):
  File "C:/Users/hp/PycharmProjects/K_2/T1.py", line 1, in <module>
    import numpy as np
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\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\\hp\\AppData\\Local\\Programs\\Python\\Python37\\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: 


Process finished with exit code 1

I tried 'pip install numpy==1.19.3' command as it was mentioned as a solution in a similar question. But it did not work either. Can someone help me in this?

Rmd90
  • 97
  • 4
  • what is the issue mentioned? – rioV8 Nov 08 '20 at 11:28
  • RuntimeError: The current Numpy installation ('C:\\Users\\hp\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. – Rmd90 Nov 08 '20 at 11:29
  • `See this issue for more information:` What is after this – rioV8 Nov 08 '20 at 11:30
  • a simple W3 search: https://stackoverflow.com/q/64654805/9938317 – rioV8 Nov 08 '20 at 11:32
  • See this issue for more information: a url -> fmod(), after an update to windows 2004, is causing a strange interaction with other code – Rmd90 Nov 08 '20 at 11:35
  • I tried the mentioned solution in https://stackoverflow.com/q/64654805/9938317 but didn't work. – Rmd90 Nov 08 '20 at 11:36
  • what is that URL? – rioV8 Nov 08 '20 at 11:39
  • https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html – Rmd90 Nov 08 '20 at 11:40
  • try install python 3.8 or 3.9 and use virtual environments (module venv) to install numpy 1.19.3 to be sure you have a clean install of numpy and can start a clean install if needed – rioV8 Nov 08 '20 at 12:13
  • 4
    Thanks @rioV8. Finally got a solution. When I checked the interpreter it still showed numpy v as 1.19.4 though I executed 'pip install numpy==1.19.3' in cmd. I uninstalled it in the interpreter and reinstalled 1.19.3. Then it worked. – Rmd90 Nov 08 '20 at 12:51
  • 1
    Thanks @Rosh, it worked for me! I first did `pip uninstall numpy` and then `pip install numpy==1.19.3` – JinSnow Nov 13 '20 at 17:37

0 Answers0