【专题:Python3】问题解决:module 'scipy.misc' has no attribute 'imsave' / 'imread' 报错

AttributeError: module 'scipy.misc' has no attribute 'imread' 主要原因是我install的scipy版本是1.4.0的,只有1.0.0版本以下的才有imread和imwrite属性。 解决方案: 1、卸载之前的scipy:pip uninstall scipy 2、下载1.0.0版本:pip install scipy==1.0.0 3、或者下载1.2.0版本的同时再配置pillow: pip install scipy==1.0.0 pip instal... 阅读详情

1. 问题:

报错 ⇒ AttributeError: module ‘scipy.misc’ has no attribute ‘imsave’
or
报错 ⇒ AttributeError: module ‘scipy.misc’ has no attribute ‘imread’

2. 配置版本:

Python:Python 3.7.1
scipy:scipy 1.4.1

3. 报错原因:

Python 3中的scipy库/模块中imsave(),imread()等方法在新版本(scipy 1.4.1)中被弃用了,虽然降版本(手动安装scipy 1.2.1或更低版本)可以,但是可以用Python3中其它模块代替使用

4. 最佳解决方案:

Step_1 引用库修改:
删除:import scipy.misc
改成: import imageio(若未安装,请先 pip install imageio)
Step_2 call方法修改:
删除:input_image = scipy.misc.imread(IMG_PATH)
改成:input_image = imageio.imread(IMG_PATH)
删除:save_image = scipy.misc.imsave(PATH, DATA)
改成:save_image = imageio.imsave(PATH, DATA)

无需降级scipy的情况下解决AttributeError: module ‘scipy.misc’ has no attribute ‘imread’,imresize,imsave等问题 无需降级scipy的情况下解决AttributeError: module ‘scipy.misc’ has no attribute ‘imread’, AttributeError: module ‘scipy.misc’ has no attribute ‘imresize’, AttributeError:module ‘scipy.misc’ has no attribute ‘imsave’问题 imread,imresize,imsave 最近遇到如下三个错误 AttributeError: module ‘scipy.misc’ has no attribute ‘imread 立即下载

相关推荐

银河麒麟V10离线环境下的Python项目迁移:从Windows依赖到ARM架构适配

本文详细介绍了在银河麒麟V10离线环境下将Python项目从Windows迁移到ARM架构的完整流程。重点讲解了离线安装pip、virtualenv等基础工具的方法,以及如何解决ARM架构兼容性问题,确保项目依赖正确迁移。文章还提供了常见问题解决方案和性能优化建议,帮助开发者顺利完成国产化平台适配工作。

weixin_42639246的博客 423

【报错】python使用scipy库时报错:AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘

问题: 调用scipy.misc模块中imsave保存图片时报错:AttributeError: module ‘scipy.misc’ has no attribute ‘imsave’ 修改前代码: from scipy import misc #导入库 import matplotlib.pyplot as plt #导入库 f = misc.face() #调用函数 misc.imsave('face.png',f) #打开图像 plt.imshow(f) #显示图像 plt.s

weixin_46302510的博客 1450

arcgis建筑数据的矢量化(一)

简单来说,建筑数据的获取无外乎是矢量化和去网站下载 无奈的是,osm和网上的建筑数据只有全国的主要城市,实在是为难我们这些小城市的,百度和天地图上是有建筑数据,无奈人家不要开放下载啊,所以就只能矢量化咯, 矢量化,无外乎手动和自动,手动就是新建shp面手动勾绘,这里就不讲了,我们来看看自动矢量化 自动矢量化在arcgis中主要是利用arcscan和栅格转面(栅格转面这个效果真是一言难尽,所以我们主要讨论arcscan) 同时我们矢量化也不一定要局限于arcgis...

Jasenjane的博客 3926

解决:AttributeError: module ‘scipy.misc’ has no attribute ‘imsave’

背景 在使用之前的代码时,报错: Traceback (most recent call last): File "xxx", line xx, in misc.imsave(output_path, scaled_temp) AttributeError: module 'scipy.misc' has no attribute 'imsave' 翻译: ``` 追溯(最近一次通话): 文件“xxx”,第xx行,在中 misc.imsave ... ...

nings666的博客 2360

Halcon dyn_threshold详解

dyn_threshold 原型 dyn_threshold(OrigImage, ThresholdImage : RegionDynThresh : Offset, LightDark : ) 功能 利用局部阈值分割图像 参数列表 OrigImage (input_object):原始图像 ThresholdImage (input_object):处理后图像(一般采用滤波处理) RegionDynThresh (output_object):分割后区域 Offset (input_control):灰

ZiLiangQin的博客 1万+

军品研制过程评审活动-(一)论证阶段

军品研制过程评审活动-(一)论证阶段

Abel的博客 3815

AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘ | 有效解决

AttributeError: module 'scipy.misc' has no attribute 'imsave' 成功解决

专注于AI领域前沿技术学习与分享:目标检测、图像修复、超分重建、AI工程化 1266

SAP_FICO模块-资产减值功能对折旧和残值的影响

SAP_FICO模块-资产减值操作对资产历史折旧以及后续折旧的影响,包括减值操作的配置前提

风沙的博客 2805

Python报错module 'scipy.misc' has no attribute 'imsave' 或者'imread'

Python报错module 'scipy.misc' has no attribute 'imsave' 有的帖子说 需要安装 pillow 然后我pip installpillow 依然没有用 还是报错 有的帖子说 需要安装moviepy 以及pillow 然后我pip install moviepy 依然没有用 还是报错 新建一个.py文件: import scipy.misc ...

u013318356的博客 1万+

Gemini-CLI 登录失败?解决报错 This account requires setting the GOOGLE_CLOUD_PROJECT env var 的问题

🚀 刚装好 `gemini-cli` 就遇到登录拦路虎?别慌!本文带你深入解析 `GOOGLE_CLOUD_PROJECT` 环境变量错误的根源,并提供超详细的图文解决方案,让你丝滑开启 AI 命令行之旅!快来抄作业!✍️

XiaoqiangClub的博客 5137

【ArcGIS微课1000例】0149:Geographic Imager6.6下载安装教程

首先保证电脑上安装对应版本的PS软件,笔者安装的是PS2023(V24.7)版本,然后安装本软件。保持以上窗口运行状态,然后打开PS,自动弹出如下窗口。勾选【Automatically checkout LIcense】,点击Close。双击setup开始安装,点击【确认】,一路默认安装到底。驱动器:DVD-ROM驱动器(用于DVD版本)处理器:2GHz或更快的英特尔或AMD处理器。安装完成后,将Crack中的所有文件拷贝到。硬盘:600 MB的可用硬盘空间用于安装。内存:4GB内存(建议8GB或更高)。

智慧空间实验室 1217

关键一步:报错module 'scipy.misc' has no attribute 'imsave' 或者'imread'

ok 先来说说网上的关于该问题的解决: 有的帖子说: 需要安装 pillow 用pip list 查看,发现这个包已经存在了,然后我把这个包卸载了,用pip install pillow 安装上依然没有用 还是报错 还有的帖子说:需要安装moviepy使用pip install moviepy 安装好包以后 ,依然没有用 还是报错 还有的帖子说scipy 1.3.0版本的不行,需要安装1.2....

zkbaba的博客 8201

Qt c++ llama.cpp 运行 LLaMA-3-8B 中文对话机器人(多模态输入)

助手:

寒寒豆豆软件公司的博客 219

(四)AttributeError module 'scipy.misc' has no attribute 'imsave'

编码~总是有很多小麻烦。 把旧电脑上的代码放到新电脑上面出现了这个问题。 在Import scipy.misc,使用imsave时候报错。 AttributeError: module ‘scipy.misc’ has no attribute 'imsave’ 但是 from PIL import Image 却没有任何问题,说明pillow是没有问题的。 于是换了一种导入包的方法: from ...

wh6046的博客 1万+

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Python报错module 'scipy.misc' has no attribute 'imsave'

Python报错module 'scipy.misc' has no attribute 'imresize' Python报错module 'scipy.misc' has no attribute 'imsave' 此类的报错,可安装 Pillow 解决 pip install  Pillow 或pip3 install  Pillow...

u014516174的博客 7471

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

解决module scipy.misc has no attribute imsave报错办法

当我们想要打开scipy.misc.imsave()包中的图像,出现了这样的报错怎么做 from scipy import misc import matplotlib.pyplot as plt f = misc.face() misc.imsave('face.png', f) # uses the Image module (PIL) plt.imshow(f) plt.show() Traceback (most recent call last): File "D:/pycharm/p

学海无涯的博客 4807

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

AttributeError module ‘scipy.misc‘ has no attribute ‘imsave‘

module 'scipy.misc' has no attribute 'imsave'的解决方法

zy的博客 1308

【python 报错module ‘scipy.misc‘ has no attribute ‘imsave‘】

我们可以看到报错的原因是在scipy.misc中找不到属性‘imsave’接下来我们拓展一下错误在遇到相同错误时可同样解决: 当我们遇到相同报错如 imsave,imread,imwrite等属性或者关于其他包的其他属性找不到时,我们可以分析一下产生错误的原因是什么?首先我们看一下其他帖子的解决方式:我的方式:我们可以看到没有我们所需要的属性所以我们换一种实现方法:(不知道还有什么实现方法可以晚上搜,相信大家都会吧!) 使用imageio模块代替scipy.misc 模块 将两者属性输出,查看: 我们会

weixin_52762273的博客 4527

'scipy.misc' has no attribute 'imsave'解决办法

背景 调用scipy.misc模块中imsave保存图片遇到的问题。 原因 其实是1.20版本之前的scipy模块中有imread 和imsave的方法,但在1.20版本后换成了其他的函数。 如imsave换成了imageio.imwrite。 imsave` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use ``ima...

白雪少年 1万+

遇到问题:[已解决] Python报错module ‘scipy.misc‘ has no attribute ‘imsave‘

https://blog.csdn.net/u013318356/article/details/95340391 方法1 有的帖子说 需要安装 pillow 然后我pip install pillow 依然没有用 还是报错 方法2 有的帖子说 需要安装moviepy 以及pillow 然后我pip install moviepy 依然没有用 还是报错 测试验证: 新建一个.py...

计算机视觉 6506

python纠错之旅(4)——AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘

问题: 出现AttributeError: module 'scipy.misc' has no attribute 'imsave' 原因: 该函数已经弃用 解决方案: 使用matplotlib模块中image下的.imsave()函数,将numpy数组转成图片保存。具体代码如下: from matplotlib import image image.imsave(filename,image_array,cmap='gray') # cmap常用于改变绘制风格,如黑白gray,翠绿色virdidis

qq_44955314的博客 995

无需降级scipy的情况下解决AttributeError: module 'scipy.misc' has no attribute 'imread',imresize,imsave等问题

无需降级scipy的情况下解决AttributeError: module ‘scipy.misc’ has no attribute ‘imread’,和AttributeError: module ‘scipy.misc’ has no attribute 'imresize’和AttributeError:module ‘scipy.misc’ has no attribute 'imsav...

qq_38835585的博客 1万+

两步解决AttributeError: module 'scipy.misc' has no attribute 'imsave'

AttributeError: module ‘scipy.misc’ has no attribute ‘imsave’ 最近使用tensorflow遇到该问题,下面是解决方法 安装pillow并降级scipy到1.2.1版本以下 具体操作: pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple pip install s...

weixin_43884418的博客 3077

已解决:AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘

【代码】已解决:AttributeError: module ‘scipy.misc‘ has no attribute ‘imsave‘

qq_53354720的博客 687

AttributeError: 'module' object (scipy.misc) has no attribute 'imsave'

运行程序时发现显示scipy.misc 没有 imsave 的错误,查找官网: scipy.misc.imsave 其中注释: This function is onlhy available is python imaging library (PIL) is installed. 1. 因此应当首先安装 PIL. 根据自己所用python 版本选则 pip install pillow 或...

One Way的博客 1721
上一篇: 【专题:R语言】问题解决:library(xlsx) 无法导入(涉及到:rjava,xlsxjar,xlsx)| 附 R代码和测试实例
下一篇: 笔记本电脑 外接扩屏显示器,如何提升屏幕分辨率,改善模糊、放大、像素低问题(也有 电脑息屏 睡死无法启动 / 悄咪咪就自动重启 的解决方案)
GUO_Julie
博客等级 码龄9年 21粉丝 4原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值