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 ...
随机推荐
- 【代码备份】ORACLE数据库表同步DBLINK
---创建目标数据库连接DBLINKcreate database link testdblink connect to xxx identified by "xxx"using ...
- docker: error pulling image configuration: Get https://xx net/http: TLS handshake timeout
很明显可以看出是连接不到 docker hub,那就需要查看网络原因了.可能需要个梯子.当然较简单的解决办法就是用国内的仓库,下面的方法就是使用国内的 daocloud 的仓库: $ echo &qu ...
- 《剑指offer》算法题第十二天
今天是<剑指offer>算法题系列的最后一天了,但是这个系列并没有包括书上的所有题目,因为正如第一天所说,这些代码是在牛客网上写并且测试的,但是牛客网上并没有涵盖书上所有的题目. 今日题目 ...
- 【CUDA 基础】3.1 CUDA执行模型概述
title: [CUDA 基础]3.1 CUDA执行模型概述 categories: CUDA Freshman tags: CUDA SM SIMT SIMD Fermi Kepler toc: t ...
- 8.4 JavaScript(一)
参考链接:http://how2j.cn/k/javascript/javascript-javascript-tutorial/519.html 一.JavaScript是什么 JavaScript ...
- SSRF和XSS-filter_var(), preg_match() 和 parse_url()绕过学习
0x01:url标准的灵活性导致绕过filter_var与parse_url进行ssrf filter_var() (PHP 5 >= 5.2.0, PHP 7) filter_var — 使用 ...
- TCP窗口扩大选项Window Scale
窗口扩大选项使TCP的窗口定义从16bit增加到32bit.这并不是通过修改TCP首部来实现的,TCP首部仍然使用16bit,而是通过定义一个选项实现对16bit的扩大操作来完成的.于是TCP在内部将 ...
- xftp上传文件到虚拟机linux失败问题
如果想通过xftp上传文件到虚拟机linux时,可能会产生上传失败的问题 原因: 因为有些文件是只可读,所以要修改文件权限,可读可写,才可以上传成功. 解决方法: 第一种方法:用xftp连接虚拟机后, ...
- Nodepad++中将Tab键替换为空格
Nodepad++是一个非常优秀的文本编辑工具,本人经常使用其编辑shell脚本,如果不进行设置,Tab键和空格混用,脚本上传到linux后,格式错乱,不容易查看. 设置方式 菜单栏选择"设 ...
- Php+Redis函数使用总结
因项目需求,冷落了redis,今天再重新熟悉一下: <?php //连接 $redis = New Redis(); $redis->connect('127.0.0.1','6379', ...