i need a program to open png files. I found this on the internet, but this gives me an error.
from PIL import Image
im = Image.open("D:/foto's/fbshare.png")
im.show()
this is the error:
AttributeError: partially initialized module 'PIL.Image' has no attribute 'open' (most likely due to a circular import)
does anybody have the solution to this problem?
I use matplotlib.image
as mpimg
and matplotlib.pyplot
as plt
:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image_path = "D:/foto's/fbshare.png"
image = mpimg.imread(image_path)
plt.imshow(image)
plt.show()