I try to take a screenshot and display it with the following code:
import pyautogui
im = pyautogui.screenshot()
im.show()
but it says in the console Access is denied. and pops a windows error:

same error if i save the picture and try to double click it from the explorer (not with python), but I can open it with sublime text for some reason.
code used for saving:
import pyautogui
import PIL
im = pyautogui.screenshot()
im.save(r'screenshot1.png')
im = PIL.Image.open(r'screenshot1.png')
im.show()
how do i solve this? should i change permissions on taking the screenshot somehow?