SoFunction
Updated on 2024-10-30

Solving the problem of installing numpy successfully but import error

Description of the problem

Windows error installation method:

pip3 install numpy

In this case, although the installation was successful, the following error occurs when importing numpy.

import numpy 
** 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
...
RuntimeError: The current Numpy installation ('...\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.

cure

Looked up a lot of information and ended up with:

  • numpy==1.19.3; platform_system == “Windows”
  • numpy==1.19.4; platform_system == “linux”

Windows can only install 1.19.3 and use it directlypip3 installThe command installs the latest version 1.19.4, so you need to specify the version when installing: Uninstall the installed version first!

pip3 uninstall numpy

Installation of version 1.19.3

pip3 install numpy==1.19.3

to this article on the solution to the problem of installing numpy successfully but import error is introduced to this article, more related to the success of the installation of numpy content please search for my previous articles or continue to browse the following related articles I hope you will support me in the future more!