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 ...
随机推荐
- iconv命令
iconv 用法: Usage: iconv [OPTION...] [FILE...] Convert encoding of given files from one encoding to an ...
- 经常使用的js三元表达式
语法:条件?表达式1:表达式2 . 条件的括号可要可不要的 let istrue = true; let a = (istrue === true) ? '我是true啊' : "我是fa ...
- 手机存储器在Ubuntu中的挂载位置
造冰箱的大熊猫,本文适用于Ubuntu 16.04和安卓手机@cnblogs 2018/12/6 通过USB数据线将安卓手机与Ubuntu相连,并在手机上设置“USB连接方式”为“传输文件”后,Ubu ...
- Linux下SHA256校验
一.将Hash: SHA256文件和需要检验的文件放在同一个文件夹内 二.$sha256sum -c SHA265 文件 输出: 校验文件:ok
- MySQL:如何选取Table中的50到100行
MySQL:如何选取Table中的50到100行 使用查询语句的时候,经常要返回前几条或者中间某几行数据,这个时候怎么办呢?不用担心,MySql已 经为我们提供了这样一个功能. ? 1 2 [sql] ...
- arxiv-sanity使用指南
使用介绍 https://bookdown.org/wshuyi/intro-to-scientific-writings4/reading.html#find-article-with-ai
- C# WebServices 客户端服务端
一.编写一个WebService 开发环境:VS2012 1.编写webservice阶段 打开VS2012,新建一个空的web应用程序,我这里用的Framework版本是4.5的 新建好web应用程 ...
- leetcode题目10.正则表达式匹配(困难)
题目描述: 给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 '*' 的正则表达式匹配. '.' 匹配任意单个字符'*' 匹配零个或多个前面的那一个元素所谓匹配,是要涵盖 整个 ...
- js第一次学习心得
最近开始接触js,用的是阮一峰的菜鸟教程,相对来说我觉得是比较通俗易懂的,用了很多很小的例子去讲每一个很小的细节,但对于我这种因为即将到来的团队作业做准备的,也没有办法将每个细节都理解的清楚,主要的把 ...
- VLC和Qt结合编写流媒体rtsp播放器
VLC播放器是一款功能强大且小巧的播放器,它支持多种多样的音视频格式,比如MPEG1,2以及mp3等等.并且通过Qt和VLC的结合能让每个开发者写出自己的视频流媒体播放器. Q ...