我在启动软件和更新时遇到问题 (Ubuntu 22.04)。
系统日志:
Aug 22 11:07:03 maskalev-Aspire-A514-54 systemd[3327]: Started Application launched by gnome-shell.
Aug 22 11:07:04 maskalev-Aspire-A514-54 dbus-daemon[817]: [system] Activating service name='com.ubuntu.SoftwareProperties' requested by ':1.190' (uid=1000 pid=14929 comm="/usr/bin/python3 /usr/bin/software
-properties-gtk " label="unconfined") (using servicehelper)
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: Traceback (most recent call last):
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/launchpadlib/launchpad.py", line 34, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from httplib2 import proxy_info_from_environment
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/httplib2/__init__.py", line 52, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from . import auth
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/httplib2/auth.py", line 4, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: import pyparsing as pp
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: ModuleNotFoundError: No module named 'pyparsing'
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: During handling of the above exception, another exception occurred:
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: Traceback (most recent call last):
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/usr/lib/software-properties/software-properties-dbus", line 29, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from softwareproperties.dbus.SoftwarePropertiesDBus import (
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 32, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from softwareproperties.SoftwareProperties import SoftwareProperties
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 64, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from softwareproperties.shortcuts import shortcut_handler
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/softwareproperties/shortcuts.py", line 23, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from softwareproperties.ppa import PPAShortcutHandler
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/softwareproperties/ppa.py", line 25, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from launchpadlib.launchpad import Launchpad
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/launchpadlib/launchpad.py", line 36, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from httplib2 import ProxyInfo
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/httplib2/__init__.py", line 52, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: from . import auth
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: File "/lib/python3/dist-packages/httplib2/auth.py", line 4, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: import pyparsing as pp
Aug 22 11:07:04 maskalev-Aspire-A514-54 com.ubuntu.SoftwareProperties[14940]: ModuleNotFoundError: No module named 'pyparsing'
Aug 22 11:07:04 maskalev-Aspire-A514-54 dbus-daemon[817]: [system] Activated service 'com.ubuntu.SoftwareProperties' failed: Launch helper exited with unknown return code 1
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: Traceback (most recent call last):
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 177, in activate_name_owner
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: return self.get_name_owner(bus_name)
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: reply_message = self.send_message_with_reply_and_block(
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.ubuntu.SoftwareProperties': no such name
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: During handling of the above exception, another exception occurred:
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: Traceback (most recent call last):
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/bin/software-properties-gtk", line 100, in <module>
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 210, in __init__
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: proxy = bus.get_object("com.ubuntu.SoftwareProperties", "/")
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: return self.ProxyObjectClass(self, bus_name, object_path,
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 250, in __init__
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: self._named_service = conn.activate_name_owner(bus_name)
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 182, in activate_name_owner
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: self.start_service_by_name(bus_name)
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/bus.py", line 277, in start_service_by_name
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: reply_message = self.send_message_with_reply_and_block(
Aug 22 11:07:04 maskalev-Aspire-A514-54 software-properties-gtk.desktop[14929]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
我认为 Python 有问题(路径、版本等)
maskalev@maskalev-Aspire-A514-54:~$ pip install pyparsing
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyparsing in ./.local/lib/python3.10/site-packages (3.0.9)
maskalev@maskalev-Aspire-A514-54:~$ python3 -c "import sys; print(sys.path)"
['', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/home/maskalev/.local/lib/python3.10/site-packages', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages']
maskalev@maskalev-Aspire-A514-54:~$ whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz
maskalev@maskalev-Aspire-A514-54:~$ ls /usr/bin/python*
/usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.10-config /usr/bin/python3.11-config /usr/bin/python3-futurize /usr/bin/python-dotenv
/usr/bin/python2.7-config /usr/bin/python3.10 /usr/bin/python3.11 /usr/bin/python3-config /usr/bin/python3-pasteurize
我会很高兴收到任何建议。我将根据要求发送任何其他信息
答案1
您的本地用户安装与系统软件无关。您不能使用 pip 安装系统范围的 python 软件包。
由于 Ubuntu 确实使软件中心依赖于该python3-pyparsing
软件包,因此您一定在没有dpkg
/apt
注意到的情况下以某种方式删除了该软件包(或只是其内容?)。您试图解决此问题的事实pip
让我预感您在某个地方做了类似的事情sudo pip uninstall
并破坏了您的系统。然后你很可能会在途中遇到更多破碎的事情;删除 pyparsing 不太可能不会同时删除其他关键模块。也许您实际上覆盖了python3
系统使用的可执行文件?
您可以尝试解决您眼前的问题sudo apt-get reinstall python3-pyparsing
,但我担心 python 的多个版本会扰乱您的路径,并且如果我猜测您pip
在系统中混合安装,从而以清理起来繁琐的方式破坏了它起来,你的最快的解决方案可能是保存用户的主页并重新设置 Ubuntu。您的成功可能确实因您投入的时间而异。