asweigart / pyscreeze

PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3.
BSD 3-Clause "New" or "Revised" License
193 stars 96 forks source link

pyscreeze 0.1.30 fails to execute properly on Ubuntu 22.04. #119

Open cj-neo opened 6 months ago

cj-neo commented 6 months ago

I have installed Pillow, but the following error persists. However, reverting to version 0.1.29 resolves the issue.

File "/test/.venv/lib/python3.10/site-packages/pyscreeze/__init__.py", line 628, in _screenshot_linux
    raise Exception(
Exception: To take screenshots, you must install Pillow version 9.2.0 or greater and gnome-screenshot by running `sudo apt install gnome-screenshot`
scotthaleen commented 3 weeks ago

Seems like it requires the env XDG_SESSION_TYPE to be set to x11 in order to use scrot

https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py#L95 https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py#L617