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