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 ...
随机推荐
- EXCEL中给包含某个字段的单元格所在行标注颜色
条件格式->新建规则->使用公式确定要设置格式的单元格 公式: =COUNTIF($A1,"*字符串*") 注意:通配符的使用.
- 利用协程爬网页,自动切换io 精典案例:
首先Python提供的协程库gevent好像并不能知道那些程序使用了io 所以要加一个补丁,mondey,以下同步和异步各爬一次的案例 : , from urllib import requesti ...
- 源码解析Grpc拦截器(C#版本)
前言 其实Grpc拦截器是我以前研究过,但是我看网上相关C#版本的源码解析相对少一点,所以笔者借这篇文章给大家分享下Grpc拦截器的实现,废话不多说,直接开讲(Grpc的源码看着很方便,包自动都能还原 ...
- 学生信息管理系统.cpp(大二上)
#include<iostream> #include<fstream> #include<string> #include<iomanip> #i ...
- Shell系列(7)- 通配符
通配符 通配符 作用 ? 匹配一个任意字符 * 匹配0个或任意多个任意字符,也就是可以匹配任何内容 [] 匹配中括号中任意一个字符.例如:[abc]代表一定匹配一个字符,或者是a,或者是b,或者是c. ...
- postgres 基础SQL语句 增删改
查看已创建的数据库:select datname from pg_database; 查看所有数据库的详细信息:select * from pg_database 创建数据库:create datab ...
- tomcat URI get 参数中文传到后台 乱码 URIEncoding
* 修改tomcat server.xml 找到这一行 <Connector connectionTimeout="20000" port="80" pr ...
- python编码问题:UnicodeDecodeError: 'gbk' codec can't decode
在获取yaml文件数据时,提示:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 2: illegal multib ...
- Kafka 性能篇:为何 Kafka 这么快?
『码哥』的 Redis 系列文章有一篇讲透了 Redis 的性能优化 --<Redis 核心篇:唯快不破的秘密>.深入地从 IO.线程.数据结构.编码等方面剖析了 Redis " ...
- iMAC_使用相关
MAC软件下载 https://www.macwk.com/ 这是网站是一个下载免费软件的网站,下载通过<天翼云盘>下载,这个天翼云盘下载的快 好用的软件推荐 腾讯柠檬(Tencent L ...