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 ...
随机推荐
- clickonce的密钥到期问题处理
最近clickonce的密钥到期了,在网上找了些文章用来修改密钥的到期时间,已成功生成新密钥,好不好使暂时未测. 在此小结一下,以备参考: 1.在原密钥所属电脑上cmd执行如下命令 renewcert ...
- 【C++周报】第一期2021-8-1
[C++周报]第一期 2021-8-1 这一期我们来看这道题目:https://vijos.org/p/1058 这道题是一道非常好的模拟题.题目如下: 描述 我们用文本处理器来处理一个特殊的文本文件 ...
- Docker Command and Dockerfile
镜像相关命令 # 下载镜像 docker pull xxx # 搜素镜像 docker search xxx # 查看已经下载了哪些镜像 docker images # 查看已下载镜像的id dock ...
- PHP的引用计数是什么意思?
什么是引用计数 在PHP的数据结构中,引用计数就是指每一个变量,除了保存了它们的类型和值之外,还额外保存了两个内容,一个是当前这个变量是否被引用,另一个是引用的次数.为什么要多保存这样两个内容呢?当然 ...
- 分享一个设计logo的网站
https://editor.freelogodesign.org/
- P4716-[模板]最小树形图
正题 题目链接:https://www.luogu.com.cn/problem/P4716 题目大意 给出\(n\)个点\(m\)条边的一张有向图,求以\(r\)为根的最小外向树. \(1\leq ...
- P5631-最小mex生成树【线段树,并查集】
正题 题目链接:https://www.luogu.com.cn/problem/P5631 题目大意 \(n\)个点\(m\)条边的一张图,求\(mex\)值最小的一棵生成树. 解题思路 考虑比较暴 ...
- disruptor笔记之五:事件消费实战
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
- Winform配置文件读写操作
前言 在项目当中为了增加软件的灵活性及可配置性,配置文件在程序当中起着不可替代的作用.下面介绍一下最近用的比较多的方式. config文件的操作 数据库连接字符串 1.获取连接字符串 public s ...
- caffe.cpp解析
来自链接:http://blog.csdn.net/u014114990/article/details/47747025 主要讲解:GetBrewFunction()函数定义如下,其返回BrewFu ...