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

"no enumerators available" on Linux MInt 20.1 #48

Open
Moini opened this issue Feb 17, 2021 · 15 comments
Open

"no enumerators available" on Linux MInt 20.1 #48

Moini opened this issue Feb 17, 2021 · 15 comments

Comments

@Moini
Copy link

Moini commented Feb 17, 2021

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.

@Robware
Copy link

Robware commented Feb 17, 2021

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

@rr-
Copy link
Owner

rr- commented Feb 17, 2021

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

@Moini
Copy link
Author

Moini commented Feb 18, 2021

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)

@rr-
Copy link
Owner

rr- commented Feb 18, 2021

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()))'

@Robware
Copy link

Robware commented Feb 18, 2021

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.

@Moini
Copy link
Author

Moini commented Feb 18, 2021

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')]

@rr-
Copy link
Owner

rr- commented Feb 18, 2021

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?

@Moini
Copy link
Author

Moini commented Feb 18, 2021

Done: tryptech/obs-zoom-and-follow#7

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

@tryptech
Copy link

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?

@Moini
Copy link
Author

Moini commented Feb 18, 2021

@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.

@tryptech
Copy link

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.

@Moini
Copy link
Author

Moini commented Feb 19, 2021

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?

@adawolfs
Copy link

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

@rr-
Copy link
Owner

rr- commented Mar 30, 2021

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

JonathanSalwan/Triton#276

@alliadt
Copy link

alliadt commented Apr 12, 2021

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

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

6 participants