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

Guake suddenly not starting any more due to ModuleNotFoundError: No module named 'importlib_metadata' #1962

Closed
stefanofornari opened this issue Oct 30, 2021 · 13 comments · Fixed by #1964

Comments

@stefanofornari
Copy link

stefanofornari commented Oct 30, 2021

Guake stopped to start. Launching it from the command line, it provides the following output, complaining it can not find the module import_metadata:

[ste ~] o(= guake
Guake not running, starting it
Loading Gnome schema from: /usr/lib/python3/dist-packages/guake/data
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.guake3.RemoteControl': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guake/main.py", line 451, in main
    remote_object = bus.get_object(DBUS_NAME, DBUS_PATH)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.guake3.RemoteControl was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guake/__init__.py", line 28, in guake_version
    import importlib.metadata as importlib_metadata
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3/dist-packages/guake/main.py", line 616, in exec_main
    if not main():
  File "/usr/lib/python3/dist-packages/guake/main.py", line 467, in main
    instance = Guake()
  File "/usr/lib/python3/dist-packages/guake/guake_app.py", line 123, in __init__
    or self.settings.general.get_string("schema-version") != guake_version()
  File "/usr/lib/python3/dist-packages/guake/__init__.py", line 30, in guake_version
    import importlib_metadata
ModuleNotFoundError: No module namModuleNotFoundError: No module named 'importlib_metadata'ed 'importlib_metadata'

I tried to reinstall but no luck...

  • Guake Version: see in about box.
    3.8.1-1ppabionic0

  • Please describe your system (Linux distribution and GNOME version).

  uname -a
Linux minidesktop 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
@xFEARx
Copy link

xFEARx commented Oct 31, 2021

The same for me

@Davidy22
Copy link
Collaborator

Davidy22 commented Nov 1, 2021

What version of python is default/does Guake run on on your system? Does pip install importlib_metadata resolve the issue for you?

It looks like you're using the PPA. Did this issue begin when you upgraded from a a PPA version, or from the repo version to the PPA?

@stefanofornari
Copy link
Author

stefanofornari commented Nov 1, 2021 via email

@Davidy22
Copy link
Collaborator

Davidy22 commented Nov 1, 2021

importlib_metadata is a pip package to provide the functionality of importlib.metadata to python versions below 3.8. For now, solutions would be to either have Guake use python 3.8 or higher, or to get importlib_metadata. Can add a fallback as well for cases where neither can be done, for next release.

Davidy22 added a commit to Davidy22/guake that referenced this issue Nov 1, 2021
Davidy22 added a commit to Davidy22/guake that referenced this issue Nov 1, 2021
Davidy22 added a commit to Davidy22/guake that referenced this issue Nov 1, 2021
@stefanofornari
Copy link
Author

Hello,
thanks for supporting. I have installed python3.8 and fixed guake as below:

[ste ~] o(= cat /usr/bin/guake
#!/usr/bin/python3.8
# PBR Generated from 'console_scripts'

import sys

from guake.main import exec_main

if __name__ == "__main__":
    sys.exit(exec_main())

When I run it I get:

[ste ~] =)o guake
Traceback (most recent call last):
  File "/usr/bin/guake", line 6, in <module>
    from guake.main import exec_main
  File "/usr/lib/python3/dist-packages/guake/main.py", line 49, in <module>
    from guake.support import print_support
  File "/usr/lib/python3/dist-packages/guake/support.py", line 5, in <module>
    import gi
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)

let me know if I can be of further help.

@Davidy22
Copy link
Collaborator

Davidy22 commented Nov 1, 2021

Regarding this line:

File "/usr/lib/python3/dist-packages/guake/main.py", line 49, in <module>

Has Guake been installed via pypi before on this machine? Potential colliding installations

@stefanofornari
Copy link
Author

Has Guake been installed via pypi before on this machine?

No I would say never, for sure not after it stopped to work. I have purged and reinstalled it once, just to see if improved, and installed python3.8 through normal apt install python-3.8

@Davidy22
Copy link
Collaborator

Davidy22 commented Nov 2, 2021

I suspect something hasn't been linked properly to python 3.8, and it can't find the files provided by python-gi. The solution would be to install pygobject via pip, but if we can't use pip then the patch adding a fallback for the original issue should make Guake runnable on your system's default python version, and should be part of Guake 3.8.2

@marcelkottmann
Copy link

marcelkottmann commented Nov 2, 2021

Downgrade in ubuntu for reference:

# get previous available versions from cache
apt-cache showpkg guake  

# install previous version (mine was 3.0.5-1)
sudo apt install guake=3.0.5-1

# turn off automatic updates for guake for now
sudo apt-mark hold guake

@stefanofornari
Copy link
Author

stefanofornari commented Nov 2, 2021 via email

@logix2
Copy link

logix2 commented Nov 22, 2021

For those using the Guake Linux Uprising PPA: on Ubuntu, Guake now needs to depend on python3-importlib-metadata, so I have updated the Guake package for Ubuntu 20.04 and newer with this change. For Ubuntu 18.04, which doesn't have this package in its repositories, I have added this pull request #1964 as a patch so the latest Guake 3.8.1 should now work on Ubuntu 18.04.

@stefanofornari
Copy link
Author

Great! I confirm it works now on Ubuntu 18.04.

@Davidy22
Copy link
Collaborator

Oh, should we be adding python3-importlib-metadata to our own debian bootstrap script?

PhungXuanAnh pushed a commit to PhungXuanAnh/guake that referenced this issue Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants