I'm facing this issue when running systemctl status dbus
on Ubuntu 22.04.5 LTS:
$ sudo systemctl status dbus● dbus.service - D-Bus System Message Bus Loaded: loaded (/lib/systemd/system/dbus.service; static) Active: active (running) since Fri 2024-09-20 12:12:57 CEST; 12min agoTriggeredBy: ● dbus.socket Docs: man:dbus-daemon(1) Main PID: 1050 (dbus-daemon) Tasks: 1 (limit: 38025) Memory: 5.1M CPU: 1.544s CGroup: /system.slice/dbus.service└─1050 @dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-onlysep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: File "/lib/python3/dist-packages/softwareproperties/ppa.py", line 25, in <module>sep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: from launchpadlib.launchpad import Launchpadsep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: File "/lib/python3/dist-packages/launchpadlib/launchpad.py", line 36, in <module>sep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: from httplib2 import ProxyInfosep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: File "/lib/python3/dist-packages/httplib2/__init__.py", line 52, in <module>sep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: from . import authsep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: File "/lib/python3/dist-packages/httplib2/auth.py", line 4, in <module>sep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: import pyparsing as ppsep 20 12:20:32 username-ThinkPad-P15s com.ubuntu.SoftwareProperties[23869]: ModuleNotFoundError: No module named 'pyparsing'sep 20 12:20:32 username-ThinkPad-P15s dbus-daemon[1050]: [system] Activated service 'com.ubuntu.SoftwareProperties' failed: Launch helper exited with unknown return code 1
and some system application don't start, e.g.
$ software-properties-gtkTraceback (most recent call last): File "/usr/lib/python3/dist-packages/dbus/bus.py", line 177, 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 return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH, File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking reply_message = self.send_message_with_reply_and_block(dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.ubuntu.SoftwareProperties': no such nameDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/bin/software-properties-gtk", line 100, in <module> app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file) File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 210, in __init__ proxy = bus.get_object("com.ubuntu.SoftwareProperties", "/") File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object return self.ProxyObjectClass(self, bus_name, object_path, File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 250, in __init__ self._named_service = conn.activate_name_owner(bus_name) File "/usr/lib/python3/dist-packages/dbus/bus.py", line 182, in activate_name_owner self.start_service_by_name(bus_name) File "/usr/lib/python3/dist-packages/dbus/bus.py", line 277, in start_service_by_name return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH, File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking reply_message = self.send_message_with_reply_and_block(dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
I'm pretty sure it's because the Python package pyparsing
is installed twice;
- at the system level where it was certainly automatically installed:
$ apt-cache policy python3-pyparsingpython3-pyparsing: Installed: 2.4.7-1 Candidate: 2.4.7-1
and the second, probably coming as a dependency with some packages that I installed manually in the /usr/local/lib/python3.10/dist-packages
directory:
$ pip list -v | grep "Version\|pyparsing"Package Version Location Installer------------- ------------ ------------------------------------------- ---------pyparsing 3.0.9 /usr/local/lib/python3.10/dist-packages pip
Those other packages are:
$ pip show pyparsing | grep ^Required-byRequired-by: httplib2, matplotlib, snuggs
Because pyparsing
exists twice, Ubuntu should never complain about "not finding it"! 🫤
How could I tell Ubuntu's applications and system tasks to make use of the Python package directory installed by its own apt
package management system before the one in the directory /usr/local/lib/python3.10/dist-packages
?