. Advertisement .
..3..
. Advertisement .
..4..
The error: “runtimeError: package fails to pass a sanity check for numpy and pandas” is a common error that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
When Does The Error: “runtimeError: package fails to pass a sanity check for numpy and pandas” Happen?
When utilizing python3.9 and numpy1.19.4, this issue may occur.
RuntimeError: The current Numpy installation ('...\\venv\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.
You have encountered the error “runtimeError: package fails to pass a sanity check for numpy and pandas” because you are utilizing Python 3.9 with Numpy 1.19.4.
How To Solve The Error: “runtimeError: package fails to pass a sanity check for numpy and pandas”
Approach 1: Instead of 1.19.4, utilize NumPy 1.19.3
Instead of 1.19.4, let’s utilize NumPy 1.19.3 to solve your error ”runtimeError: package fails to pass a sanity check for numpy and pandas”.
The similar method proposed here worked for many people in Python 3.7.
pip install numpy==1.19.3
Approach 2: Simply downgrade the NumPy version
This problem happens when you utilize Python 3.9 with Numpy 1.19.4. Therefore, you simply need to uninstall Numpy 1.19.4 and replace it with Numpy 1.19.3, which will work.
NumPy 1.19.3 is a minor maintenance update, incudes two great devolopments:
- Python 3.9 binaries wheels on all platforms that are supported.
- Windows 10 version 2004 fmod problem is fixed by OpenBLAS.
To get around some of the fmod issues on Windows 10 version 2004, this release supports Python 3.6–3.9 and is coupled with OpenBLAS 0.3.12. Microsoft is aware of the issue, and customers are advised to update once a fix is made available. However, this particular workaround is restricted in bound.
Approach 3: Simply install numpy==1.19.3.
To solve the error “runtimeError: package fails to pass a sanity check for numpy and pandas” you simply need to install numpy==1.19.3 when utilizing Python 3.9.
Approach 4: Utilize PEP508
According to NumPy dev’s response:
“NumPy has released a bugfix 1.19.3 to work around this issue. The bugfix broke something else on Linux, so we had to revert the fix in release 1.19.4, but you can still install the 1.19.3 via pip install numpy==1.19.3.”
Therefore, if you want requirements that perform on both Linux and Windows, let’s utilize PEP508:
numpy==1.19.3; platform_system == "Windows"
numpy>=1.19.4; platform_system == "linux"
Approach 5: Utilize the prior version
It’s a NumPy 1.19.4 problem that affects all Python versions. To fix this issue, utilize the prior version, so by terminal:
pip install numpy==1.19.3
All above solutions are very simple, aren’t they? However, they work very flawlessly. They will make your error completely disappear and your program will run well. So, what are you waiting without applying them for your error? They won’t make you disappointed.
Conclusion
We hope you enjoyed our article about the error. With this knowledge, we know that you can fix your error: “runtimeError: package fails to pass a sanity check for numpy and pandas” quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Read more
→ Resolve The Error: RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED in Python
Leave a comment