python numpy版本报错: File "*\numpy\__init__.py", line 305, in <module> _win_os_check()
具体代码如下所示:
from numpy import *
import operator a = random.rand(4, 4)
print(a)
具体报错内容如下所示:
Traceback (most recent call last):
File "D:/py_prj/rtl_split/venv/Include/test.py", line 1, in <module>
from numpy import *
File "*\numpy\__init__.py", line 305, in <module>
_win_os_check()
File "*\numpy\__init__.py", line 302, in _win_os_check
raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('*\\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
参考资料:https://github.com/numpy/numpy/wiki/FMod-Bug-on-Windows
There is a Bug with fmod on windows, see https://tinyurl.com/y3dm3h86
To prevent unexpected runtime behavior, opencv contains a Check for this:
try:
a = arange(13 * 13, dtype= float64).reshape(13, 13)
a = a % 17 # calls fmod
linalg.eig(a)
except Exception:
raise RuntimeError("The current Numpy installation (...) fails to pass a sanity check due to a bug in the windows runtime. ...
See Pull Request https://github.com/numpy/numpy/pull/17553
Workaround
This is a windows issue and has to be fixed by Microsoft, however, a fix has not arrived for several weeks now.
Pinning against NumPy 1.19.3 should help (it uses a newer OpenBLAS version, but this caused other problems). This can be achieved using e.g. with
pip install numpy==1.19.3or similar depending on your setup. To be clear: The only difference between NumPy 1.19.3 and 1.19.4 is the OpenBLAS version it ships.32bit Python does not have these issues
In principle you could revert the buggy windows update or deactivate the
_win_os_checkin NumPy (if you are lucky, your code is unaffected by the bug).
原因:是1.19.4版本有问题,需要安装1.19.3版本


更换版本后使用 import numpy
numpy.__version__ 可以查看该版本号
python numpy版本报错: File "*\numpy\__init__.py", line 305, in <module> _win_os_check()的更多相关文章
- phoenix客户端连接hbase数据库报错:Traceback (most recent call last): File "bin/sqlline.py", line 27, in <module> import argparse ImportError: No module named argparse
环境描述: 操作系统版本:CentOS release 6.5 (Final) phoenix版本:phoenix-4.10.0 hbase版本:hbase-1.2.6 现象描述: 通过phoenix ...
- ubuntu16 升级pip3后报错File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'
问题:ubuntu16 执行pip3 install --upgrade pip之后,pip3执行出错. Traceback (most recent call last): File "/ ...
- 【Egret】web版本报错:XMLHttpRequest cannot load
[Egret] web发行版本报错:XMLHttpRequest cannot load file:///C:/Users/PX/Documents/EgretProjects/Xt1/resourc ...
- mysql版本报错
IntelliJIdea2019.3打开原项目报mysql版本报错: Error opening zip file or JAR manifest missing : /C:/Users/flycat ...
- Android 6.0以后的版本报错:open failed: EACCES (Permission denied)
Android 6.0以后的版本报错:open failed: EACCES (Permission denied) 在开发项目中,遇见要进行文件操作,遇见Caused by: android.sys ...
- 安装python File "/usr/bin/pip", line 11, in <module> sys.exit(main()) File "/usr/lib/python3.4/site-packages/pip/__init__.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/u
$ uname -a Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU ...
- C#或Net连接Oracle操作提示 Oracle 客户端 version 8.1.7 或更高版本报错
异常问题 远程连接ORCALE 服务器,而本地未安装任何ORCALE 相关客户端及ODAC .using System.Data.OracleClient;当我们用程序操作Oracle库的时候,OPE ...
- windows server2012 R2安装python3.x版本报错0x80240017
windows server2012 R2安装python3.x版本报错0x80240017 环境: windows server 2012 R2系统 问题: 安装python3.5版本时候出现错误0 ...
- 树莓派(Raspberry Pi 3) centos7使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid ...
随机推荐
- Xamarin UIProgressView自定义
Progress.ProgressImage = UIImage.FromFile ("progress.png"); Progress.TrackImage = UIImage. ...
- dedecms织梦调用指定文章id
{dede:arclist idlist="1349" channelid="1" addfields="date,city"} idli ...
- P4717-[模板]快速莫比乌斯/沃尔什变换(FMT/FWT)
正题 题目链接:https://www.luogu.com.cn/problem/P4717 题目大意 给出两个长度为\(2^n\)的数列\(A,B\)求 \[C_{n}=\sum_{i\ or\ j ...
- AT4120-[ARC096D]Sweet Alchemy【贪心,背包】
正题 题目链接:https://www.luogu.com.cn/problem/AT4120 题目大意 给出\(n\)个物品和一个容量\(m\),第\(i\)个物品体积为\(c_i\).除了第一个物 ...
- 技术与艺术的结合,HMS Core让手机主题趣味丛生
在9月23日晚举办的华为nova9系列新品发布会上,华为在发布nova9系列新机之外,还为观众展示了多款Harmony OS趣味主题.其中一款名为"翻滚吧牛奶"的应用主题看起来十分 ...
- 感恩笔记之二_SQL语句扩展功能
前言导读: 本章是对SQL语句基础功能中,一些功能用法的扩展使用的总结,都是实际工作中一些经验的积累. 1 select列查询功能组合使用 --1 函数处理+列计算+列改名 select 函数(列) ...
- 【Docker】(9)---每天5分钟玩转 Docker 容器技术之镜像
镜像是 Docker 容器的基石,容器是镜像的运行实例,有了镜像才能启动容器.为什么我们要讨论镜像的内部结构? 如果只是使用镜像,当然不需要了解,直接通过 docker 命令下载和运行就可以了. 但如 ...
- t-SNE算法
t-SNE 算法 前言 t-SNE(t-distributed stochastic neighbor embedding) 是用于降维的一种机器学习算法,由 Laurens van der Maat ...
- HTML5背景知识
目录 HTML5背景知识 HTML的历史 JavaScript出场 浏览器战争的结束 插件称雄 语义HTML浮出水面 发展态势:HTML标准滞后于其使用 HTML5简介 新标准 引入原生多媒体支持 引 ...
- Vue3学习(三)之网站首页布局开发
一.前言 上篇文章已经提到集成Ant Design Vue后,和Element Ui一样,还是组件的使用,然后就是复制粘贴改了. 二.实际案例 先搞个布局布局看看,也就是我们说的layout,如下图: ...