简体   繁体   中英

python PIL show image - file system error

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?

You need to change the startup type of your Windows license management service. Search for "Services" in your computer, and open the Services Management. Find the Windows license management service, and change the startup type to "Automatic". Press "apply" and "ok". Refer to this for visualization of the process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM