henrywoo / kazam

Kazam - Linux Desktop Screen Recorder and Broadcaster
GNU General Public License v3.0
136 stars 15 forks source link

[BUG] WARNING Kazam - Failed to correctly detect operating system. #19

Closed DemonRx closed 1 year ago

DemonRx commented 1 year ago

Kazam version: 1.5.6 Installation method: pip install kazam OS: Ubuntu 22.04.2 LTS

Errors:

WARNING Kazam - Failed to correctly detect operating system.
/home/demon/.local/lib/python3.10/site-packages/kazam/backend/webcam.py:24: PyGIWarning: GUdev was imported without specifying a version first. Use gi.require_version('GUdev', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GObject, GUdev
/home/demon/.local/lib/python3.10/site-packages/kazam/backend/gstreamer.py:35: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GObject, Gst, GstVideo
Traceback (most recent call last):
  File "/home/demon/.local/bin/./kazam", line 148, in <module>
    from kazam.app import KazamApp
  File "/home/demon/.local/lib/python3.10/site-packages/kazam/app.py", line 39, in <module>
    from kazam.backend.gstreamer import Screencast, GWebcam
  File "/home/demon/.local/lib/python3.10/site-packages/kazam/backend/gstreamer.py", line 35, in <module>
    from gi.repository import GObject, Gst, GstVideo
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 136, in load_module
    raise ImportError('cannot import name %s, '
ImportError: cannot import name GstVideo, introspection typelib not found
DemonRx commented 1 year ago

Adding import gi is needed due to warnings on the files:

  File "/home/demon/.local/lib/python3.10/site-packages/kazam/backend/gstreamer.py", line 22, in <module>
    gi.require_version('Gst', '1.0')
  File "/home/demon/.local/lib/python3.10/site-packages/kazam/backend/webcam.py", line 22, in <module>
    gi.require_version('GUdev', '1.0')
NameError: name 'gi' is not defined

after this correction and specifying versions where necessary. The result is:

WARNING Kazam - Failed to correctly detect operating system.
Traceback (most recent call last):
  File "/home/demon/.local/bin/./kazam", line 148, in <module>
    from kazam.app import KazamApp
  File "/home/demon/.local/lib/python3.10/site-packages/kazam/app.py", line 39, in <module>
    from kazam.backend.gstreamer import Screencast, GWebcam
  File "/home/demon/.local/lib/python3.10/site-packages/kazam/backend/gstreamer.py", line 41, in <module>
    from gi.repository import GObject, Gst, GstVideo
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 136, in load_module
    raise ImportError('cannot import name %s, '
ImportError: cannot import name GstVideo, introspection typelib not found

The part that says ImportError: cannot import name GstVideo, introspection typelib not found

Is apparently a dependency issue? Trying to determine how to solve it.

DemonRx commented 1 year ago

The part that says ImportError: cannot import name GstVideo, introspection typelib not found

Is apparently a dependency issue? Trying to determine how to solve it.

To resolve this:

The following packages need to be installed: gir1.2-gst-plugins-base-1.0 gir1.2-gst-plugins-bad-1.0

Which leads to another error:

ImportError: cannot import name Wnck, introspection typelib not found

That is resolved by installing the package: gir1.2-wnck-3.0

The program successfuly initialized after these dependencies were installed and version requirements satisfied.

DemonRx commented 1 year ago

Will open a PR to fix