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'的更多相关文章

  1. Python报错——module 'scipy.misc' has no attribute 'imresize'

    报错是因为要安装PIL库,库名现在为Pillow,在命令行上安装即可: pip3 install Pillow

  2. module 'scipy.misc' has no attribute 'toimage',python

    anaconda环境下: 错误:python 命令行运行出错:module 'scipy.misc' has no attribute 'toimage' 解决:打开Anaconda prompt,输 ...

  3. AttributeError: module 'scipy.misc' has no attribute 'imread'

    运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...

  4. 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 ...

  5. python报错“AttributeError: 'set' object has no attribute 'items'“

    作为才开始学爬虫的萌新,遇到了一个这样的错,很懵逼 后面到网络到处查看大佬的解决方法,才发现headers的请求头部信息有错误,headers是一个字典,不是字符串,所以报错了 原代码 headers ...

  6. Python报错ModuleNotFoundError: No module named 'numpy'

    转载:https://blog.csdn.net/qq_39779233/article/details/103224712 Python报错ModuleNotFoundError: No modul ...

  7. 学习笔记71—Python 报错处理集

    ****************************************************** 如有谬误,请联系指正.转载请注明出处. 联系方式: e-mail: heyi9069@gm ...

  8. Python报错总结丶自定义报错

    Python报错总结: 常见异常 1,NameError: name 'a' is not defined:未定义函数名             2,IndentationError: uninden ...

  9. selenium python 报错“ unable to find binary in default location”

    selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...

随机推荐

  1. keil中使用Astyle格式化你的代码的方法-keil4 keil5通用

    简介:在给RTT 提交代码,需要符合RT-Thread 的代码规范,本文简单介绍如何使用Astyle 格式化为符合RTT要求的代码风格. 关于Astyle Astyle 的全称是Artistic St ...

  2. BZOJ 2242 / Luogu P2485 [SDOI2011]计算器 (BSGS)

    type 1type\ 1type 1 就直接快速幂 type 2type\ 2type 2 特判+求逆元就行了. type 3type\ 3type 3 BSGS板 CODE #include< ...

  3. ORA-03113:通信通道的文件结尾处理

     ORA-03113:通信通道的文件结尾执行:alter system set "_optimizer_join_elimination_enabled"=false; cmdsq ...

  4. 强制数据类型转换之Number类型

    ㈠强制类型转换 1.定义:指将一个数据类型强制转换为其他的数据类型    类型转换主要指,将其他的数据类型,转换为String ,Number, Boolean ㈡将其他的数据类型转换为Number ...

  5. selenium 与appium的关系

    selenium是web端的自动化,appium是app端的自动化,它继承了webdriver(也就是selenium 2) 关系如下:

  6. java+文件批量下载

    这篇文章主要介绍了Java实现批量下载选中文件功能,非常不错,具有参考借鉴价值,需要的朋友可以参考下 1.在action中定义变量 private List<String> downLoa ...

  7. Linux系统启动顺序

    Linux启动顺序 加电—加电自检(BIOS)—硬件检查 —MBR(找到需要启动的系统,由于实际计算机上可能会装有多个系统) —bootloader系统初始化,装载kenel到内存 —内核执行,决定哪 ...

  8. (考试大整理~)Xxy 的车厢调度

    这一题我以前研究过哈哈哈~ (train.cpp/c/pas) Description 有 一 个 火 车 站 , 铁 路 如 图 所 示 ,每辆火车从 A 驶入,再从 B 方向驶出,同时它的车厢可以 ...

  9. jmeter操作登录等简单的使用

    一.登录 1.打开jmeter创建“线程组” 2.创建HTTP默认值 3.添加http默认值后,后边的http请求就可以省略填写部分内容 4.添加“HTTP信息管理头”在内添加名称:“Content- ...

  10. TypeScript----接口和泛型

    接口 TypeScript的核心原则之一是对值所具有的结构进行类型检查.它有时被称做“鸭式辨型法”或“结构性子类型化”.在TypeScript里,接口的作用就是为这些类型命名和为你的代码或第三方代码定 ...