Tkinter: cannot import name '_imagingtk'的解决办法
来源:互联网 发布:linux git 配置文件 编辑:程序博客网 时间:2024/06/05 06:02
关于Tkinter中display an image in a label ,原生PhotoImage语句的image格式只支持gif,
为了能够加载JPG格式,需要这样操作:
把
img = PhotoImage(file='myimage.gif')
替换成
from PIL importImage, ImageTk
img =ImageTk.PhotoImage(Image.open("myimage.jpg"))
label['image'] = img但是在这个过程中出现了如下错误:
ImportError:cannot import name '_imagingtk'
在stackoverflow中搜索了一些类似问题,经尝试可以这样解决:
pip install –I pillow
pillow安装完成后重启IDE我使用的是Python 3.4.3 |Anaconda 2.3.0 (64-bit)
0 0
- Tkinter: cannot import name '_imagingtk'的解决办法
- python scrapy cannot import name '_win32stdio'的解决办法
- python导入词云包失败:ImportError:cannot import name ‘WordCloud’的解决办法
- cannot import name 'Flask' 的错误
- python MySQLdb ImportError: cannot import name conversions 解决办法
- 【Scrapy】Scrapy在Python3下报错:“cannot import name '_win32stdio'”解决办法
- cannot import name multivariate_normal
- cannot import name imread
- cannot import name MLPClassifier
- cannot import name filter
- cannot import name usrp解决方法
- python cannot import name XXX
- ImportError: cannot import name Pseudo
- Python ImportError: cannot import name *
- ImportError: cannot import name IncompleteRead
- ImportError: cannot import name HTTPSHandler
- importError: cannot import name 'izip_longest'
- ImportError: cannot import name mkdtemp
- android中图片规格
- 内核时间子系统的配置
- FZU 2230 翻翻棋 (找规律 水题)
- Python简介
- hjr教程-汇编(一):地址与数据
- Tkinter: cannot import name '_imagingtk'的解决办法
- sqoop从hbase导出数据到mysql
- Java Persistence with MyBatis 3(中文版) 第五章 与Spring集成
- HDOJ/HDU 1982 Kaitou Kid - The Phantom Thief (1)(字符串处理)
- (Macbook Air)BCM4360网卡Linux(Ubuntu/Fedora)驱动安装总结
- 几种相册图片布局方式
- 实例讲解设计模式中的命令模式在iOS App开发中的运用
- BUG:eclipse中添加V7包ERROR: In <declare-styleable> MenuView, unable to find attribute android:pre
- Unity 与 Android (Android Studio)的交互问题研究 (一)