Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

mss.exception.ScreenShotError: XGetImage() failed on Debian 10 #621

Closed
ghost opened this issue Oct 16, 2019 · 3 comments
Closed

mss.exception.ScreenShotError: XGetImage() failed on Debian 10 #621

ghost opened this issue Oct 16, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 16, 2019

Trying to run iris from Debian 10 I get an error with XGetImage(). There were no obvious errors when running bootstrap.sh so I assume all the dependencies were properly installed.

(iris_firefox) iris@iris-testing-debian:~/iris_firefox$ iris
Traceback (most recent call last):
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/bin/iris", line 5, in <module>
    from moziris.scripts.main import main
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/scripts/main.py", line 18, in <module>
    from moziris.api.keyboard.key import KeyModifier
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/__init__.py", line 10, in <module>
    from moziris.api.finder.finder import *
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/finder/finder.py", line 11, in <module>
    from moziris.api.finder.image_search import image_find, match_template, image_vanish
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/finder/image_search.py", line 24, in <module>
    from moziris.api.screen.display import DisplayCollection
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/screen/display.py", line 78, in <module>
    DisplayCollection = _get_display_collection()
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/screen/display.py", line 64, in _get_display_collection
    res.append(Display(index))
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/screen/display.py", line 19, in __init__
    self.scale = _get_scale(screen_id)
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/moziris/api/screen/display.py", line 72, in _get_scale
    screenshot = mss.mss().grab(display)
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/mss/linux.py", line 430, in grab
    ZPIXMAP,
  File "/home/iris/.local/share/virtualenvs/iris_firefox-_dt__UE3/lib/python3.7/site-packages/mss/linux.py", line 171, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XGetImage() failed
@KWierso
Copy link
Contributor

KWierso commented Oct 16, 2019

Sounds similar to https://stackoverflow.com/questions/55085064/xgetimage-failed-error-when-using-python-mss-library-on-ubuntu

Wonder if you can try installing a different version of mss and get it to work? We're using debian10 in CI, so it should be working.

@ghost
Copy link
Author

ghost commented Oct 23, 2019

I tried installing some older versions (mss 4.0.2, 4.0.1, and 4.0.0) but I got the same traceback as above. Note, Iris appears to require mss 4.0.3 as when I install an older version I get an error: "ERROR: moziris 0.6 has requirement mss==4.0.3, but you'll have mss 4.0.1 which is incompatible."

@ghost
Copy link
Author

ghost commented Oct 29, 2019

I think I found the problem. On Debian 10 Wayland is the default whereas on Ubuntu 16.04 it is X11. Logging out on Debian 10 and switching to a GNOME X11 session got this working. I'm going to file an issue for us to add support for Wayland since that is the default on many a Linux distribution.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant