[software development] 使用PyAutoGUI截屏报错
Tofloor
poster avatar
deepin
2023-12-01 18:07
Author

目前想用python PyAutoGUI模块截图操作鼠标进行自动点击,windows下执行正常,想在linux桌面环境下执行,结果报错,是不是只能gnome桌面才能使用,dde桌面不支持

image.png

Reply Favorite View the author
All Replies
👀偷偷观察
deepin
2023-12-01 18:34
#1

sudo apt-get install scrot

欢迎加入deepin的qq交流群:498845518

Reply View the author
deepin
2023-12-01 18:41
#2
👀偷偷观察

sudo apt-get install scrot

欢迎加入deepin的qq交流群:498845518

看了下pyscreeze和PIL两个依赖包源码,pyscreeze有判断可以使用scrot, PIL默认linux下使用的是gnome-screenshot,没有scrot,是不是桌面环境只能换ubuntu测试了

Reply View the author
👀偷偷观察
deepin
2023-12-01 19:00
#3

看了下pyscreeze和PIL两个依赖包源码,pyscreeze有判断可以使用scrot, PIL默认linux下使用的是gnome-screenshot,没有scrot,是不是桌面环境只能换ubuntu测试了

image.png

还有一种情况:

image.png

欢迎加入deepin的qq交流群:498845518

Reply View the author
deepin
2023-12-01 19:06
#4
👀偷偷观察

image.png

还有一种情况:

image.png

欢迎加入deepin的qq交流群:498845518

安装了
image.png

`Package Version


MouseInfo 0.1.3
numpy 1.21.6
opencv-python 4.8.1.78
Pillow 9.5.0
pip 23.3.1
pkg_resources 0.0.0
PyAutoGUI 0.9.54
PyGetWindow 0.0.9
PyMsgBox 1.0.9
pyperclip 1.8.2
PyRect 0.2.0
PyScreeze 0.1.30
python3-xlib 0.15
pytweening 1.0.7
setuptools 40.8.0
wheel 0.42.0
`

Reply View the author
mike
deepin
2023-12-01 19:06
#5

Exception: To take screenshots, you must install Pillow version 9.2.0 or greater and gnome-screenshot by running sudo apt install gnome-screenshot

报错都明示了让安装这个包了

Reply View the author
deepin
2023-12-01 19:16
#6
mike

Exception: To take screenshots, you must install Pillow version 9.2.0 or greater and gnome-screenshot by running sudo apt install gnome-screenshot

报错都明示了让安装这个包了

有安装,直接执行gnome-screenshot命令也是第一行这个报错

Reply View the author
👀偷偷观察
deepin
2023-12-01 20:25
#7

有安装,直接执行gnome-screenshot命令也是第一行这个报错

image.png

https://ubuntuforums.org/showthread.php?t=1751455

Reply View the author