Python报错module 'scipy.misc' has no attribute 'xxx'
Python报错module 'scipy.misc' has no attribute 'imresize'
解决办法:
安装Pillow包,命令如下:
pip install Pillow
然后重启python环境
Python报错module 'scipy.misc' has no attribute 'imread'
解决办法:
大部分解决办法都是说没有安装PIL第三方库,库名现在为Pillow,推荐直接使用命令pip install Pillow进行安装,但是我的问题并没有因此得到解决,还是继续报错AttributeError: module 'scipy.misc' has no attribute 'imread'。
经过查询和尝试,发现是scipy的版本问题, 降级到scipy==1.2.1就可以完美解决了。
命令如下:
pip install scipy==1.2.1
原因探究:

如果您查看的scipy.misc.imresize许多最新版本的文档scipy,则会在顶部找到以下内容:
imresize不推荐使用!
imresize在SciPy 1.0.0中已弃用,在1.3.0中将被删除。
改为使用枕头:numpy.array(Image.fromarray(arr).resize())。
1.3.0发行版是昨天发行的,因此,如果scipy今天在系统上下载,您可能已经获得了新版本,该新版本将无法再使用该功能。
我在上面引用的文档提出了一个代码片段(使用numpy和PIL),它可以替代。
所以出现以上类似问题的根本原因还是scipy版本的问题
Python报错module 'scipy.misc' has no attribute 'xxx'的更多相关文章
- Python报错——module 'scipy.misc' has no attribute 'imresize'
报错是因为要安装PIL库,库名现在为Pillow,在命令行上安装即可: pip3 install Pillow
- module 'scipy.misc' has no attribute 'toimage',python
anaconda环境下: 错误:python 命令行运行出错:module 'scipy.misc' has no attribute 'toimage' 解决:打开Anaconda prompt,输 ...
- AttributeError: module 'scipy.misc' has no attribute 'imread'
运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...
- Tensorflow机器学习入门——AttributeError: module 'scipy.misc' has no attribute 'toimage'
这个bug的解决办法: import cv2 # scipy.misc.toimage(image_array).save('cifar10_data/raw/%d.jpg' % i) cv2.imw ...
- python报错“AttributeError: 'set' object has no attribute 'items'“
作为才开始学爬虫的萌新,遇到了一个这样的错,很懵逼 后面到网络到处查看大佬的解决方法,才发现headers的请求头部信息有错误,headers是一个字典,不是字符串,所以报错了 原代码 headers ...
- Python报错ModuleNotFoundError: No module named 'numpy'
转载:https://blog.csdn.net/qq_39779233/article/details/103224712 Python报错ModuleNotFoundError: No modul ...
- 学习笔记71—Python 报错处理集
****************************************************** 如有谬误,请联系指正.转载请注明出处. 联系方式: e-mail: heyi9069@gm ...
- Python报错总结丶自定义报错
Python报错总结: 常见异常 1,NameError: name 'a' is not defined:未定义函数名 2,IndentationError: uninden ...
- selenium python 报错“ unable to find binary in default location”
selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...
随机推荐
- GIT 工作流程常用用命令大全
一.Git基本工作流程 1.Git工作区域 2.向仓库中添加文件流程 二.Git初始化及仓库创建和操作 1.Git安装之后需要进行一些基本信息设置 a.设置用户名:git config -- g ...
- Java-判断是否为回文数
/** * @ClassName: IsPalindrome * @author: bilaisheng * @date: 2017年9月19日 下午2:54:08 * 判断是否为回文数 * true ...
- pytorch tensor 维度理解.md
torch.randn torch.randn(*sizes, out=None) → Tensor(张量) 返回一个张量,包含了从标准正态分布(均值为0,方差为 1)中抽取一组随机数,形状由可变参数 ...
- 征途堆积出友情的永恒「堆优化dp」
直接写题解: 很简单的dp暴力转移式子:f[i]=MAX{f[j]+max(tax[j],sum[i]-sum[j])} 观察式子,只有一个变量sum[i]; 而其他都为定量; 则考虑维护 两个定量: ...
- flask框架(一):初入
1.装饰器回顾 # -*- coding: utf-8 -*- # @Author : Felix Wang # @time : 2018/7/3 17:10 import functools &qu ...
- 使用Hexo和Github搭建博客站
本人电脑系统为window 10专业工作站版,64位 相关步骤: 1.安装Node.js和配置好Node.js环境,打开cmd命令行,成功界面如下 2.安装Git和配置好Git环境,安装成功的象征就是 ...
- Jmeter(十二)常用插件
一.下载及安装 下载地址:https://jmeter-plugins.org/install/Install/ 下载后文件为一个jar包,将其放入jmeter安装目录下的lib/ext目录,然后重启 ...
- Hive 利用 on tez 引擎 合并小文件
Hive 利用 on tez 引擎 合并小文件 标签(空格分隔): Hive \[f(N) + \sum_{i=2}^N f(N-i+1)*X_i\] SET hive.exec.dynamic.pa ...
- conda程序使用
conda -c 参数 使用清华镜像时不要使用-c 参数.-c参数是anaconda的默认channel. 查询安装源中某个包的可以安装的版本 conda search -f package_name ...
- springboot加载bean过程探索
springboot一般通过以下main方法来启动项目 @SpringBootApplication public class DemoApplication { public static void ...