-2

I got this error trying to install another package: the current Numpy installation fails to pass a sanity check due to a bug in the windows runtime. Ive checked the problem and it seems to occur using the newest version of numpy (1.19.4). I then downgraded and it still didnt work. I then tried a lot of deinstalling, reinstalliung and whatnot until it seems I destroyed my numpy completely. Even the simplest functions do not work anymore. Right now im back to version 1.19.4, but when I try to use it, it says the object is not callable. Example:

import numpy as np

print(np.random(10))

TypeError: 'module' object is not callable

It might be because of permissions? I got these messages while reinstallilng numpy: "ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verweigert: 'C:\Users\...\Anaconda3\Lib\site-packages\~-mpy\.libs\libopenblas.NOIJJG62EMASZI6NYURL6JBKM4EVBGM7.gfortran-win_amd64.dll' Consider using the --user option or check the permissions."

"ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verweigert: 'C:\Users\...\Anaconda3\Lib\site-packages\~andas\_libs\algos.cp38-win_amd64.pyd' Consider using the --user option or check the permissions."

RuntimeError: The current Numpy installation ('C:\Users\...\AppData\Local\Temp\pip-build-env-h9d1jjmf\overlay\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:

I even reinstalled anaconda but I think the oldest numpy just reinstalls itself. Which is the easiest way to reset my numpy completely? (I tried the obvious pip uninstall numpy and pip install numpy...)

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Elias
  • 51
  • 8

1 Answers1

0

You want np.random.random(10). np.random is the module, np.random.random is the function.

Documentation: https://numpy.org/doc/stable/reference/random/generated/numpy.random.random.html

Random Davis
  • 6,662
  • 4
  • 14
  • 24
  • okay, oops. But the other problem still stands ( fails to pass a sanity check due to a bug in the windows runtime.)) Any other solution than downgrading? im using python 3.9 – Elias Dec 04 '20 at 16:47
  • @Elias I googled that error and found [this thread](https://stackoverflow.com/questions/64654805/how-do-you-fix-runtimeerror-package-fails-to-pass-a-sanity-check-for-numpy-an), why did none of those solutions work for you? – Random Davis Dec 04 '20 at 17:05
  • yes, I saw that one too. I tried that but I still got some errors. I think I found the solution: The downgrading didnt properly work because I dont have admin rights on my work computer. So something went wrong in between uninstalling and reinstalling. – Elias Dec 05 '20 at 11:22
  • Now I installed numpy 1.19.3 locally but still get the sanity check fail.... I dont get it – Elias Dec 05 '20 at 11:28