Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 22.04: No enumerators available #71

Open
iandol opened this issue Oct 19, 2022 · 3 comments
Open

Ubuntu 22.04: No enumerators available #71

iandol opened this issue Oct 19, 2022 · 3 comments

Comments

@iandol
Copy link

iandol commented Oct 19, 2022

On Ubuntu 22.04 running under X11 (not Wayland), with screeninfo 0.8.1.

I'm hitting this error as screeninfo is a dependency of https://github.com/threedworld-mit/tdw -- xrandr works fine directly in the command line...

▶︎ python3 -m screeninfo xrandr

Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/__main__.py", line 23, in <module>
    main()
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/__main__.py", line 18, in main
    for monitor in get_monitors(args.enumerator):
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/screeninfo.py", line 21, in get_monitors
    return list(ENUMERATOR_MAP[Enumerator(name)].enumerate_monitors())
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/enumerators/xrandr.py", line 65, in enumerate_monitors
    xlib = load_library("X11")
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/util.py", line 11, in load_library
    return ctypes.cdll.LoadLibrary(path)
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libX11.so.6: cannot open shared object file: No such file or directory
 ▷ python3 -m screeninfo xinerama

Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/__main__.py", line 23, in <module>
    main()
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/__main__.py", line 18, in main
    for monitor in get_monitors(args.enumerator):
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/screeninfo.py", line 21, in get_monitors
    return list(ENUMERATOR_MAP[Enumerator(name)].enumerate_monitors())
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/enumerators/xinerama.py", line 20, in enumerate_monitors
    xlib = load_library("X11")
  File "/home/cog5/.virtualenvs/tdw/lib/python3.10/site-packages/screeninfo/util.py", line 11, in load_library
    return ctypes.cdll.LoadLibrary(path)
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libX11.so.6: cannot open shared object file: No such file or directory
@alters-mit
Copy link

I see that you've already opened an issue in the screeninfo repo. Maybe in the meantime TDW should just catch the OSError and then try to parse xrandr -q

@alters-mit
Copy link

You're trying to call TDWUtils.get_expected_window_position(), right? Otherwise this error shouldn't happen. You could potentially just remove that function and manually set the window position.

@iandol
Copy link
Author

iandol commented Oct 20, 2022

Correct on TDWUtils.get_expected_window_position(), I will try the workaround to not trigger this screeninfo probblem. I opened an issue here just so the author of screeninfo was aware, and @alters-mit I think you meant to post you reply on the TDW issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants