已解决The above exception was the direct cause of the following exception:
已解决RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
SystemError: returned a result with an error set
报错问题
粉丝群里面的一个小伙伴遇到问题跑来私信我,想用ddddocr模块做验证码识别,但是发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错代码如下所示:
import ddddocr
ocr = ddddocr.DdddOcr()
with open('code.png', 'rb') as f:
img_bytes = f.read()
res = ocr.classification(img_bytes)
print(res)
报错信息截图如下所示:
报错翻译
报错信息翻译如下所示:
RuntimeError:模块根据API版本0xe编译,但此版本的numpy为0xd ImportError:numpy.core.multiarray无法导入 上述异常是以下异常的直接原因: SystemError:<内置函数__import__>返回带有错误集的结果
报错原因
报错原因:
ddddocr依赖numpy模块,因为numpy的版本较低,所以会提示版本问题。
小伙伴们按下面的方法安装执行版本即可!!!
解决方法
解决方法1:升级numpy,安装最新版本的:
pip install -U numpy
解决方法2:安装指定高版本的:
pip install numpy==1.23.4
以上是此问题报错原因的解决方法,欢迎评论区留言讨论是否能解决,如果有用欢迎点赞收藏文章谢谢支持,博主才有动力持续记录遇到的问题!!!
千人全栈VIP答疑群联系博主帮忙解决报错
由于博主时间精力有限,每天私信人数太多,没办法每个粉丝都及时回复,所以优先回复VIP粉丝,可以通过订阅限时9.9付费专栏《100天精通Python从入门到就业》进入千人全栈VIP答疑群,获得优先解答机会(代码指导、远程服务),白嫖80G学习资料大礼包,专栏订阅地址:https://blog.csdn.net/yuan2019035055/category_11466020.html
-
优点:作者优先解答机会(代码指导、远程服务),群里大佬众多可以抱团取暖(大厂内推机会),此专栏文章是专门针对零基础和需要进阶提升的同学所准备的一套完整教学,从0到100的不断进阶深入,后续还有实战项目,轻松应对面试!
-
专栏福利:简历指导、招聘内推、每周送实体书、80G全栈学习视频、300本IT电子书:Python、Java、前端、大数据、数据库、算法、爬虫、数据分析、机器学习、面试题库等等
-
注意:如果希望得到及时回复,和大佬们交流学习,订阅专栏后私信博主进千人VIP答疑群
相关文章
- maven配置报错以及The JAVA_HOME environment variable is not defined correctly的解决方法
- python, 解决:WARNING: Running pip as the 'root' user can result in broken permissions and conflicti...
- 【错误记录】Android Studio 创建报错 ( The length of the module location exceeds the limit of 100 characters. )
- 【错误记录】Android Studio 编译报错 ( The project is using an incompatible version (AGP 7.4.2) of the Androi )
- ORA-01378: The logical block size (string) of file string is not compatible with the disk sector size (media sector size is string and host sector size is string) ORACLE 报错 故障修复 远程处理
- ORA-28086: The evaluation of the policy expression failed. string ORACLE 报错 故障修复 远程处理
- ORA-31053: The value of the depth argument in the operator cannot be negative ORACLE 报错 故障修复 远程处理
- ORA-31128: The event handler calls cannot exceed the depth of string ORACLE 报错 故障修复 远程处理
- ORA-31691: The worker received message number string from the MCP, which is invalid. ORACLE 报错 故障修复 远程处理
- ORA-32342: The EXPLAIN_MVIEW facility failed to explain the materialized view statement ORACLE 报错 故障修复 远程处理
- ORA-46015: The value of the “paramDatatype” element is too long. ORACLE 报错 故障修复 远程处理
- ORA-48412: The parameters exceeds the maximum number [string] ORACLE 报错 故障修复 远程处理
- ORA-48439: The input path name exceeds the maximum length [string] ORACLE 报错 故障修复 远程处理
- ORA-48441: The function parameter number exceeds the maximum number [string] ORACLE 报错 故障修复 远程处理
- ORA-48444: The single “.” and “*” cannot appear in the middle of the path ORACLE 报错 故障修复 远程处理
- ORA-48491: The program name is too long, exceeds the maximum length [string] ORACLE 报错 故障修复 远程处理
- ORA-53010: The value of the tag is null. ORACLE 报错 故障修复 远程处理
- ORA-55567: The _highthreshold_undoretention value should be at least string based on the current undo retention settings. ORACLE 报错 故障修复 远程处理
- ORA-02324: more than one column in the SELECT list of THE subquery ORACLE 报错 故障修复 远程处理
- ORA-13614: The template string is not compatible with the current advisor. ORACLE 报错 故障修复 远程处理
- ORA-13906: The tablespace is not of the right type. ORACLE 报错 故障修复 远程处理
- The Power of Linux: Unleashing the Potential of OpenSource Software(linux英文)
- the cloudTaking Oracle to the Cloud: The Evolution of Database Systems(oracleisin)
- 修复 Ubuntu 中 “E: The package cache file is corrupted, it has the wrong hash”
- Exploring the Dynamic Duo: The Power of Solr MongoDB Integration(solrmongodb)
- Exploring the Power of MongoDB: The Definitive Guide to Upgrading Arrays(mongodb更新数组)
- Exploring the versatility of Linux: The significance of the var directory(linux系统var)