Python Forum
Error while importing numpy - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Error while importing numpy (/thread-31208.html)



Error while importing numpy - Erfan - Nov-28-2020

Hello,
I have installed Python 3.9 on windows 10(I also installed Anaconda). after that I installed pip because I wanna install numpy. but when I import numpy, I see error below. Does anyone know what should I do to solve this problem?
Thanks Heart
>>> import numpy as np
Error:
Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import numpy as np File "C:\Users\moham\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module> _win_os_check() File "C:\Users\moham\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\\moham\\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
Thanks to all, specially bowlofred.
Quote:pip uninstall numpy
then
pip install numpy==1.19.3



RE: Error while importing numpy - ndc85430 - Nov-28-2020

There seem to be several workarounds on that page, while a proper fix is in the works. Did you at least try any of them?


RE: Error while importing numpy - buran - Nov-28-2020

(Nov-28-2020, 07:28 AM)Erfan Wrote: but there's nothing.
there are at least 2 workaround solutions + explanation when to expect windows fix of the issue that caused the underling bug in the first place (probably around Jan 2021).
The most straightforward workaround is to install exactly numpy 1.19.3 version


RE: Error while importing numpy - bowlofred - Nov-28-2020

You say "there's nothing" in that thread, but there are several workarounds mentioned. Have you tried them and they don't work, or have you not tried them?

* Downgrade to numpy 1.19.3
Quote:pip uninstall numpy

then

pip install numpy==1.19.3
* Use WSL (windows linux) and python/numpy there.
* Install the 32-bit version of python/numpy.