On Ubuntu 22.04 running under X11 (not Wayland).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