chmouel/gnome-next-meeting-applet

ImportError: cannot import name AppIndicator3, introspection typelib not found

GabLeRoux opened this issue · 1 comments

  • Gnome Next Meeting applet version: 0.2.0
  • Python version: 3.8.10
  • Operating System: Ubuntu 20.04.3 LTS

Description

First execution after installation based on ReadMe's instructions:

gnome-next-meeting-applet-auth
Traceback (most recent call last):
  File "/usr/bin/gnome-next-meeting-applet-auth", line 11, in <module>
    load_entry_point('gnome-next-meeting-applet==0.1.0', 'console_scripts', 'gnome-next-meeting-applet-auth')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/gnome_next_meeting_applet/auth.py", line 24, in <module>
    import gnome_next_meeting_applet.applet as gnma
  File "/usr/lib/python3/dist-packages/gnome_next_meeting_applet/applet.py", line 32, in <module>
    from gi.repository import AppIndicator3 as appindicator
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 132, in load_module
    raise ImportError('cannot import name %s, '
ImportError: cannot import name AppIndicator3, introspection typelib not found

So I went a bit deeper on this. I've read the code and introspection typelib is about PyGobject. There's one of the required .typelib that cannot be found during dynamic import.

Fix is something like this:

sudo apt-get install gir1.2-appindicator3-0.1

Once installed, the command line seems to start correctly, but with a warning:

/usr/lib/python3/dist-packages/gnome_next_meeting_applet/applet.py:32: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator

Warning is something that needs to be fixed in the code.