AttributeError: type object ‘Image‘ has no attribute ‘open‘
Cause analysis: the calling sequence of image is wrong, because the from PIL import image in the first line conflicts with Tkinter import * in the second line, and Tkinter also contains image class, so you use tkinter.image
Solution: from PIL import image as IMIM
Original call sequence
try:
from PIL import Image
except ImportError:
import Image
import tkinter as tk
from tkinter import *
from tkinter import filedialog
Original call sequence
import tkinter as tk
from tkinter import *
from tkinter import filedialog
try:
from PIL import Image
except ImportError:
import Image
Read More:
- Solution: attributeerror: type object ‘ioloop’ has no attribute ‘initialized’
- [Solved] spacy Install Error: AttributeError: type object ‘_CleanResult‘ has no attribute ‘from_link‘
- Attributeerror: object has no attribute
- AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- Attributeerror: ‘bytes’ object has no attribute’ encode ‘
- Attributeerror: ‘dataframe’ object has no attribute ‘IX’ error
- AttributeError: ‘Tensor‘ object has no attribute ‘_numpy‘
- Problem: attributeerror: ‘tensor’ object has no attribute ‘creator’
- AttributeError:‘AxesSubplot’object has no attribute‘bar_label’
- AttributeError: ‘Settings’ object has no attribute ‘ROOT_URLCONF’
- AttributeError: ‘PipelinedRDD‘ object has no attribute ‘toDF‘
- python gensim AttributeError: ‘Doc2Vec‘ object has no attribute ‘dv‘
- Debug | AttributeError: ‘numpy.int64‘ object has no attribute ‘to_pydatetime‘
- AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
- AttributeError: ‘_io.TextIOWrapper‘ object has no attribute ‘softspace‘
- AttributeError: ‘dict‘ object has no attribute ‘iteritems‘
- Python AttributeError: ‘bool‘ object has no attribute ‘ui‘
- AttributeError: ‘numpy.ndarray‘ object has no attribute ‘softmax‘
- Attributeerror: ‘STR’ object has no attribute ‘decode’ solution: the pro test is successful.
- AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘