RuntimeError: The current Numpy installation fails to pass a sanity check due to a bug in the windows runtime
99,425
The temporary solution is to use numpy 1.19.3.
pip install numpy==1.19.3
From this Microsoft thread fix will be available around January 2021.
Update: it is fixed in KB4598291 update
Related videos on Youtube
Author by
James Grey
Updated on June 25, 2021Comments
-
James Grey almost 3 years
I am using Python 3.9 on Windows 10 version 2004 x64. PowerShell as Administrator.
Python verion:
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Install
matplotlib
error.pip install virtualenv virtualenv foo cd .\foo .\Scripts\active pip install numpy pip install matplotlib
Error
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\WINDOWS\system32> Set-ExecutionPolicy Unrestricted -Force PS C:\WINDOWS\system32> cd /d C:\Windows\System32\cmd.exe Set-Location : A positional parameter cannot be found that accepts argument 'C:\Windows\System32\cmd.exe'. At line:1 char:1 + cd /d C:\Windows\System32\cmd.exe + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand PS C:\WINDOWS\system32> cd C:\Windows\System32\cmd.exe cd : Cannot find path 'C:\Windows\System32\cmd.exe' because it does not exist. At line:1 char:1 + cd C:\Windows\System32\cmd.exe + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Windows\System32\cmd.exe:String) [Set-Location], ItemNotFoundExcepti on + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand PS C:\WINDOWS\system32> cd D:\ PS D:\> cd .\Users\donhuvy\ PS D:\Users\donhuvy> ls Directory: D:\Users\donhuvy Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 10/26/2020 3:35 PM AppData d----- 11/7/2020 9:33 AM PycharmProjects PS D:\Users\donhuvy> cd .\PycharmProjects\pythonProject\ PS D:\Users\donhuvy\PycharmProjects\pythonProject> virtualenv foo virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + virtualenv foo + ~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (virtualenv:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS D:\Users\donhuvy\PycharmProjects\pythonProject> pip install virtualenv Collecting virtualenv Downloading virtualenv-20.1.0-py2.py3-none-any.whl (4.9 MB) |████████████████████████████████| 4.9 MB 1.1 MB/s Collecting distlib<1,>=0.3.1 Downloading distlib-0.3.1-py2.py3-none-any.whl (335 kB) |████████████████████████████████| 335 kB 6.4 MB/s Requirement already satisfied: six<2,>=1.9.0 in c:\users\donhuvy\appdata\roaming\python\python39\site-packages (from virtualenv) (1.15.0) Collecting filelock<4,>=3.0.0 Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB) Collecting appdirs<2,>=1.4.3 Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Installing collected packages: distlib, filelock, appdirs, virtualenv Successfully installed appdirs-1.4.4 distlib-0.3.1 filelock-3.0.12 virtualenv-20.1.0 PS D:\Users\donhuvy\PycharmProjects\pythonProject> virtualenv foo created virtual environment CPython3.9.0.final.0-64 in 1312ms creator CPython3Windows(dest=D:\Users\donhuvy\PycharmProjects\pythonProject\foo, clear=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\donhuvy\AppData\Local\pypa\virtualenv) added seed packages: pip==20.2.4, setuptools==50.3.2, wheel==0.35.1 activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator PS D:\Users\donhuvy\PycharmProjects\pythonProject> cd .\foo PS D:\Users\donhuvy\PycharmProjects\pythonProject\foo> .\Scripts\activate (foo) PS D:\Users\donhuvy\PycharmProjects\pythonProject\foo> pip install numpy Collecting numpy Using cached numpy-1.19.4-cp39-cp39-win_amd64.whl (13.0 MB) Installing collected packages: numpy Successfully installed numpy-1.19.4 (foo) PS D:\Users\donhuvy\PycharmProjects\pythonProject\foo> pip install matplotlib Collecting matplotlib Using cached matplotlib-3.3.2.tar.gz (37.9 MB) ** On entry to DGEBAL parameter number 3 had an illegal value ** On entry to DGEHRD parameter number 2 had an illegal value ** On entry to DORGHR DORGQR parameter number 2 had an illegal value ** On entry to DHSEQR parameter number 4 had an illegal value ERROR: Command errored out with exit status 1: command: 'D:\Users\donhuvy\PycharmProjects\pythonProject\foo\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\donhuvy\\AppData\\Local\\Temp\\pip-install-8bn40qg7\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\donhuvy\\AppData\\Local\\Temp\\pip-install-8bn40qg7\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe' cwd: C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\ Complete output (61 lines): Edit setup.cfg to change the build options; suppress output with --quiet. BUILDING MATPLOTLIB matplotlib: yes [3.3.2] python: yes [3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]] platform: yes [win32] sample_data: yes [installing] tests: no [skipping due to configuration] macosx: no [Mac OS-X only] running egg_info creating C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info writing C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\PKG-INFO writing dependency_links to C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\dependency_links.txt writing namespace_packages to C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\namespace_packages.txt writing requirements to C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\requires.txt writing top-level names to C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\top_level.txt writing manifest file 'C:\Users\donhuvy\AppData\Local\Temp\pip-pip-egg-info-39nmc0pe\matplotlib.egg-info\SOURCES.txt' Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\setup.py", line 242, in <module> setup( # Finally, pass this all along to distutils to do the heavy lifting. File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\setuptools\__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\core.py", line 148, in setup dist.run_commands() File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\setuptools\command\egg_info.py", line 298, in run self.find_sources() File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\setuptools\command\egg_info.py", line 305, in find_sources mm.run() File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\setuptools\command\egg_info.py", line 536, in run self.add_defaults() File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\setuptools\command\egg_info.py", line 572, in add_defaults sdist.add_defaults(self) File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\command\sdist.py", line 228, in add_defaults self._add_defaults_ext() File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\command\sdist.py", line 311, in _add_defaults_ext build_ext = self.get_finalized_command('build_ext') File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\cmd.py", line 299, in get_finalized_command cmd_obj.ensure_finalized() File "d:\users\donhuvy\appdata\local\programs\python\python39\lib\distutils\cmd.py", line 107, in ensure_finalized self.finalize_options() File "C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\setup.py", line 88, in finalize_options self.distribution.ext_modules[:] = [ File "C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\setup.py", line 91, in <listcomp> for ext in package.get_extensions() File "C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\setupext.py", line 345, in get_extensions add_numpy_flags(ext) File "C:\Users\donhuvy\AppData\Local\Temp\pip-install-8bn40qg7\matplotlib\setupext.py", line 469, in add_numpy_flags import numpy as np File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\numpy\__init__.py", line 305, in <module> _win_os_check() File "D:\Users\donhuvy\PycharmProjects\pythonProject\foo\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check raise RuntimeError(msg.format(__file__)) from None RuntimeError: The current Numpy installation ('D:\\Users\\donhuvy\\PycharmProjects\\pythonProject\\foo\\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 ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. (foo) PS D:\Users\donhuvy\PycharmProjects\pythonProject\foo>
Error information link to https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html
Use Pycharm 2020.2 Ultimate also catch error.
How to fix it?
-
Jean-Claude Arbaut over 3 yearsThe problem is solved as of numpy 1.19.5, published on 2021-01-05.
-
James Grey over 3 yearsYou can post new answer, this issue received much interest.
-
Jean-Claude Arbaut over 3 yearsActually, I can't (question closed). But it's doesn't matter much.
-
-
James Grey over 3 yearsThe second temporary solution maybe is use Miniconda for Windows.
-
hekimgil over 3 yearsMine was a similar problem, with MoviePy (1.0.3) installation on a Windows machine and this Numpy version downgrade solved the problem for that too. Thanks...
-
nooshinha about 3 yearssolved my problem on Pycharm and windows. I changed the installed version from 1.19.4 to 1.19.3
-
Uri about 3 yearsThis is now April. Has this issue resolved? Can I install numpy 1.20??
-
Equinox almost 3 years@Uri yes this was resolved in February