AttributeError: type object ‘Image‘ has no attribute ‘open‘
AttributeError: type object ‘Image‘ has no attribute ‘open‘
原因分析:Image调用顺序出错,因为第一行的from PIL import Image与第二行tkinter import *冲突,tkinter中也含有Image类,所以你使用的是tkinter.Image
解决方法:from PIL import Image as imim
原调用顺序
try:from PIL import Image
except ImportError:import Imageimport tkinter as tk
from tkinter import *
from tkinter import filedialog
原调用顺序
import tkinter as tk
from tkinter import *
from tkinter import filedialogtry:from PIL import Image
except ImportError:import Image
AttributeError: type object ‘Image‘ has no attribute ‘open‘相关推荐
- 关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题
关于AttributeError: type object 'XXXXXX' has no attribute 'name'的报错的原因,先运行运行一段代码 例如: class Person(obje ...
- python 提示错误AttributeError: type object 'str' has no attribute '_name_'
在做<Machine Learning in Action>书中的第三章绘制树形图时遇到了这个问题AttributeError: type object 'str' has no attr ...
- unittest-ddt报错AttributeError: type object ‘forTestDDT‘ has no attribute ‘test_2‘
unittest 添加多个ddt数据驱动后,报错: FAILED (errors=1)Error Traceback (most recent call last):File "D:\Ana ...
- ubuntun 16.04 AttributeError: type object 'Callable' has no attribute '_abc_registry'
ubuntun 16.04 python 升级到3.7遇到各种坑 其中在openvino 跑模型时遇到以下错误: root@magicdepth-OptiPlex-7010:/opt/intel/op ...
- AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
错误描述: Traceback (most recent call last):File "D:\OCR\DBNet.pytorch-master\tools\predict.py" ...
- “AttributeError: type object ‘RocCurveDisplay‘ has no attribute ‘from_predictions‘ “.
"AttributeError: type object 'RocCurveDisplay' has no attribute 'from_predictions' ". 目录 & ...
- 解决gensim报错AttributeError: type object ‘Word2Vec‘ has no attribute ‘load_word2vec_format‘
解决方法 将报错的 from gensim.models import Word2Vecmodel = Word2Vec.load_word2vec_format('test.bin.gz', bin ...
- AttributeError:type object ‘TFLiteConverterV2 ‘has no attribute ‘form_keras_model_file ‘
在Tensor Flow2.0以上加载keras模型文件使用load_model keras_model = tf_keras_models.load_model("xx.h5") ...
- python object has no attribute_如何修复python中的“AttributeError:type object has no attribute”?...
您的代码引发此异常: AttributeError: type object 'Meeting' has no attribute 'datetime' 在这一行: meeting_start = M ...
最新文章
- Java里边什么是值传递和引用传递?两个有什么区别
- Django 笔记2 -- Django 项目
- 不安装oracle客户端如何用plsql连接oracle
- nssl1468-V【状压,数学期望,dfs】
- Spark2.x RPC解析
- Project Server 2003配置部署指南_百度文库
- java8的spliterator
- 订单编号的数据类型是什么_领域模型与代数数据类型(第三期)
- 性能无敌的HikariCP数据库连接池实战(文末送书)
- java服务器端 —— 腾讯云直播开发接入(一)
- 本周大新闻|Elbit推飞行员专属AR头盔,苹果第二代MR将分高低配
- 教育技术学就业方向_教育技术学专业就业方向与就业前景
- mysql创建视图并加注释_在mysql中为视图创建注释
- 最近邻搜索算法flann Marius Muja and David G. Lowe
- 使用代理ip会导致网络卡顿吗?
- 2022网吧行业发展前景分析
- bitcode 是什么_secured是什么意思 Secured borrowings是什么意思
- 计算机 人脑 发热 ppt,人脑即电脑,疯狂的大脑进化史,大脑科学的革命
- php订阅号怎么借服务号权限,微信订阅号已经认证能否有网页授权功能
- WebGL 和 Canvas 的关系