screeninfo icon indicating copy to clipboard operation
screeninfo copied to clipboard

"no enumerators available" on Linux MInt 20.1

Open Moini opened this issue 4 years ago • 15 comments

Hi,

I've been trying to get this obs plugin to work: https://github.com/tryptech/obs-zoom-and-follow

I've installed screeninfo today from pypi, using pip3, with the --user option.

But after including the script into obs, and then starting up obs, it gives me the following message on Linux Mint 20.1 Xfce:

[zoom_and_follow_mouse.py] Traceback (most recent call last):
[zoom_and_follow_mouse.py]   File "/home/username/.config/obs-studio/scripts/obs-zoom-and-follow-master/zoom_and_follow_mouse.py", line 19, in <module>
[zoom_and_follow_mouse.py]     class CursorWindow:
[zoom_and_follow_mouse.py]   File "/home/username/.config/obs-studio/scripts/obs-zoom-and-follow-master/zoom_and_follow_mouse.py", line 26, in CursorWindow
[zoom_and_follow_mouse.py]     d_w = get_monitors()[monitor_idx].width
[zoom_and_follow_mouse.py]   File "/home/username/.local/lib/python3.8/site-packages/screeninfo/screeninfo.py", line 37, in get_monitors
[zoom_and_follow_mouse.py]     raise ScreenInfoError("No enumerators available")
[zoom_and_follow_mouse.py] screeninfo.common.ScreenInfoError: No enumerators available

I'm having two monitors attached, configured from the Xfce settings. Please let me know which information you would need to help fix the problem.

Moini avatar Feb 17 '21 01:02 Moini

I, too, am having this problem. Same OBS plugin, Linux Mint 20.1 Cinnamon, Python 3.8.5.

Robware avatar Feb 17 '21 14:02 Robware

Can you please post the output of the following commands?

python3 -m screeninfo xrandr

and

python3 -m screeninfo xinerama

I'm using Mint with MATE and it's working fine for me

rr- avatar Feb 17 '21 23:02 rr-

Sure, thanks for your help!

The outputs are:

(xrandr)

Monitor(x=0, y=0, width=1920, height=1200, width_mm=518, height_mm=324, name='DP-1')
Monitor(x=1920, y=161, width=1680, height=1050, width_mm=474, height_mm=296, name='HDMI-2')

(xinerama)

Monitor(x=0, y=0, width=1920, height=1200, width_mm=None, height_mm=None, name=None)
Monitor(x=1920, y=161, width=1680, height=1050, width_mm=None, height_mm=None, name=None)

Moini avatar Feb 18 '21 00:02 Moini

That's very weird. I expected one of them to fail. What about two more commands?

python3 -m screeninfo

and

python3 -c 'from screeninfo import get_monitors; print(list(get_monitors()))'

rr- avatar Feb 18 '21 08:02 rr-

Here are my outputs:

$ python3 -m screeninfo xrandr
Monitor(x=3440, y=769, width=1536, height=864, width_mm=309, height_mm=174, name='eDP-1')
Monitor(x=0, y=0, width=3440, height=1440, width_mm=800, height_mm=335, name='HDMI-1')
$ python3 -m screeninfo xinerama
Monitor(x=0, y=0, width=3440, height=1440, width_mm=None, height_mm=None, name=None)
Monitor(x=3440, y=769, width=1536, height=864, width_mm=None, height_mm=None, name=None)
$ python3 -m screeninfo
Monitor(x=3440, y=769, width=1536, height=864, width_mm=309, height_mm=174, name='eDP-1')
Monitor(x=0, y=0, width=3440, height=1440, width_mm=800, height_mm=335, name='HDMI-1')
$ python3 -c 'from screeninfo import get_monitors; print(list(get_monitors()))'
[Monitor(x=3440, y=769, width=1536, height=864, width_mm=309, height_mm=174, name='eDP-1'), Monitor(x=0, y=0, width=3440, height=1440, width_mm=800, height_mm=335, name='HDMI-1')]

I also imported that bit of python script in to OBS and it didn't throw an error, which makes me wonder if it's an error in the obs-zoom-and-follow repo. However it is the screeninfo code which is raising the exception due to, apparently, not finding anything.

Robware avatar Feb 18 '21 10:02 Robware

Similar results here:

$ python3 -m screeninfo
Monitor(x=0, y=0, width=1920, height=1200, width_mm=518, height_mm=324, name='DP-1')
Monitor(x=1920, y=161, width=1680, height=1050, width_mm=474, height_mm=296, name='HDMI-2')

$ python3 -c 'from screeninfo import get_monitors; print(list(get_monitors()))'
[Monitor(x=0, y=0, width=1920, height=1200, width_mm=518, height_mm=324, name='DP-1'), Monitor(x=1920, y=161, width=1680, height=1050, width_mm=474, height_mm=296, name='HDMI-2')]

Moini avatar Feb 18 '21 10:02 Moini

I would raise an issue there and link to this one here, as it indeed looks like a problem with how this script is executed by the OBS plugin, and solving it requires us to work together. Can I please ask you to create a bug report there?

rr- avatar Feb 18 '21 11:02 rr-

Done: https://github.com/tryptech/obs-zoom-and-follow/issues/7

(currently looks like there's not a lot of activity in that repo, so not sure whether anything will come from it :-/ )

Moini avatar Feb 18 '21 12:02 Moini

Does this error in OBS show up when you first add the script to OBS, or only in the case of starting a new instance of OBS after you have added the script in?

tryptech avatar Feb 18 '21 17:02 tryptech

@tryptech Sorry, I don't remember if I got the same error already when I added the script ... But yes, it shows up every time I launch OBS now.

Moini avatar Feb 18 '21 18:02 Moini

Could you possibly remove the script and re-add it? I have this dumb gut feeling that it might be trying to get the monitors too fast.

tryptech avatar Feb 19 '21 02:02 tryptech

Sure.

  1. Reloading script: Same error.
  2. Removing, then re-adding script: Same error.

Would it make a difference that the script is located in my /home/username/.config/obs/scripts directory?

Moini avatar Feb 19 '21 11:02 Moini

I've tested it locally by printing the errors catched here

And it seems like obs is unable to properly import ctypes

[testing.py] Traceback (most recent call last):
[testing.py]   File "/home/adawolfs/obs/scripts/testing.py", line 5, in <module>
[testing.py]     from screeninfo import get_monitors
[testing.py]   File "/home/adawolfs/obs/scripts/screeninfo/screeninfo/__init__.py", line 2, in <module>
[testing.py]     from .screeninfo import get_monitors
[testing.py]   File "/home/adawolfs/obs/scripts/screeninfo/screeninfo/screeninfo.py", line 5, in <module>
[testing.py]     from screeninfo import enumerators
[testing.py]   File "/home/adawolfs/obs/scripts/screeninfo/screeninfo/enumerators/__init__.py", line 5, in <module>
[testing.py]     import screeninfo.enumerators.xrandr
[testing.py]   File "/home/adawolfs/obs/scripts/screeninfo/screeninfo/enumerators/xrandr.py", line 4, in <module>
[testing.py]     import ctypes
[testing.py]   File "/usr/lib/python3.8/ctypes/__init__.py", line 7, in <module>
[testing.py]     from _ctypes import Union, Structure, Array
[testing.py] ImportError: /usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type

adawolfs avatar Mar 29 '21 16:03 adawolfs

This sounds like an installation / packaging problem of your distro, not this library

https://github.com/JonathanSalwan/Triton/issues/276

rr- avatar Mar 30 '21 07:03 rr-

Can you please post the output of the following commands?

python3 -m screeninfo xrandr

and

python3 -m screeninfo xinerama

I'm using Mint with MATE and it's working fine for me

-- I have the same problem. Here is the result, under Windows 7 Python 3.7.6 : code>python -m screeninfo xinerama Traceback (most recent call last): File "D:\ProgramFiles\Anaconda3\lib\runpy.py", line 193, in run_module_as_main "main", mod_spec) File "D:\ProgramFiles\Anaconda3\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "E:\lib\site-packages\screeninfo_main.py", line 23, in main() File "E:\lib\site-packages\screeninfo_main.py", line 18, in main for monitor in get_monitors(args.enumerator): File "E:\lib\site-packages\screeninfo\screeninfo.py", line 29, in get_monitors return _get_monitors(enumerator) File "E:\lib\site-packages\screeninfo\screeninfo.py", line 19, in _get_monitors return list(ENUMERATOR_MAP[enumerator].enumerate_monitors()) File "E:\lib\site-packages\screeninfo\enumerators\xinerama.py", line 20, in enumerate_monitors xlib = load_library("X11") File "E:\lib\site-packages\screeninfo\util.py", line 10, in load_library raise ScreenInfoError("Could not load " + name) screeninfo.common.ScreenInfoError: Could not load X11

code>python -m screeninfo xrandr Traceback (most recent call last): File "D:\ProgramFiles\Anaconda3\lib\runpy.py", line 193, in run_module_as_main "main", mod_spec) File "D:\ProgramFiles\Anaconda3\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "E:\ib\site-packages\screeninfo_main.py", line 23, in main() File "E:\lib\site-packages\screeninfo_main.py", line 18, in main for monitor in get_monitors(args.enumerator): File "E:\lib\site-packages\screeninfo\screeninfo.py", line 29, in get_monitors return _get_monitors(enumerator) File "E:\lib\site-packages\screeninfo\screeninfo.py", line 19, in _get_monitors return list(ENUMERATOR_MAP[enumerator].enumerate_monitors()) File "E:\lib\site-packages\screeninfo\enumerators\xrandr.py", line 62, in enumerate_monitors xlib = load_library("X11") File "E:\lib\site-packages\screeninfo\util.py", line 10, in load_library raise ScreenInfoError("Could not load " + name) screeninfo.common.ScreenInfoError: Could not load X11

alliadt avatar Apr 12 '21 08:04 alliadt