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‘相关推荐

  1. 关于AttributeError: type object ‘XXX‘ has no attribute ‘XXX‘的问题

    关于AttributeError: type object 'XXXXXX' has no attribute 'name'的报错的原因,先运行运行一段代码 例如: class Person(obje ...

  2. python 提示错误AttributeError: type object 'str' has no attribute '_name_'

    在做<Machine Learning in Action>书中的第三章绘制树形图时遇到了这个问题AttributeError: type object 'str' has no attr ...

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

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

  5. AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘

    错误描述: Traceback (most recent call last):File "D:\OCR\DBNet.pytorch-master\tools\predict.py" ...

  6. “AttributeError: type object ‘RocCurveDisplay‘ has no attribute ‘from_predictions‘ “.

    "AttributeError: type object 'RocCurveDisplay' has no attribute 'from_predictions' ". 目录 & ...

  7. 解决gensim报错AttributeError: type object ‘Word2Vec‘ has no attribute ‘load_word2vec_format‘

    解决方法 将报错的 from gensim.models import Word2Vecmodel = Word2Vec.load_word2vec_format('test.bin.gz', bin ...

  8. 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") ...

  9. python object has no attribute_如何修复python中的“AttributeError:type object has no attribute”?...

    您的代码引发此异常: AttributeError: type object 'Meeting' has no attribute 'datetime' 在这一行: meeting_start = M ...

最新文章

  1. Java里边什么是值传递和引用传递?两个有什么区别
  2. Django 笔记2 -- Django 项目
  3. 不安装oracle客户端如何用plsql连接oracle
  4. nssl1468-V【状压,数学期望,dfs】
  5. Spark2.x RPC解析
  6. Project Server 2003配置部署指南_百度文库
  7. java8的spliterator
  8. 订单编号的数据类型是什么_领域模型与代数数据类型(第三期)
  9. 性能无敌的HikariCP数据库连接池实战(文末送书)
  10. java服务器端 —— 腾讯云直播开发接入(一)
  11. 本周大新闻|Elbit推飞行员专属AR头盔,苹果第二代MR将分高低配
  12. 教育技术学就业方向_教育技术学专业就业方向与就业前景
  13. mysql创建视图并加注释_在mysql中为视图创建注释
  14. 最近邻搜索算法flann Marius Muja and David G. Lowe
  15. 使用代理ip会导致网络卡顿吗?
  16. 2022网吧行业发展前景分析
  17. bitcode 是什么_secured是什么意思 Secured borrowings是什么意思
  18. 计算机 人脑 发热 ppt,人脑即电脑,疯狂的大脑进化史,大脑科学的革命
  19. php订阅号怎么借服务号权限,微信订阅号已经认证能否有网页授权功能
  20. WebGL 和 Canvas 的关系

热门文章

  1. OSPF次末节区域配置 201
  2. linux删除文件操作
  3. 【接口文档】Django restful framework中自动生成API文档
  4. 【python】pycharm启动 一直index,无法运行
  5. shell脚本执行方式,更方便更快捷。
  6. Linux进程全解12——lIPC机制之管道,SystemV IPC介绍
  7. linux pmap was java,jvm 《九》pmap linux 命令介绍 及使用
  8. json字符串和字典类型的相互转换(转载)
  9. 结对项目——最大子数组
  10. Splay初步【bzoj1503】