qpaeq 没有​​名为 dbus 的模块

qpaeq 没有​​名为 dbus 的模块

笔记:这个问题dbus与我遇到的下述问题无关。

我尝试qpaeq在安装后运行。它要求dbus。其他帖子说要安装python-dbus。这没用。也没有dbus-python,这就是qpaeq要求的。该怎么办?抄录如下:

$ sudo apt-get install pulseaudio-equalizer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-dbus.mainloop.pyqt5
The following NEW packages will be installed:
  pulseaudio-equalizer python3-dbus.mainloop.pyqt5
0 upgraded, 2 newly installed, 0 to remove and 19 not upgraded.
Need to get 50.7 kB of archives.
After this operation, 281 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-dbus.mainloop.pyqt5 amd64 5.14.1+dfsg-3build1 [16.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 pulseaudio-equalizer amd64 1:13.99.1-1ubuntu3.7 [34.0 kB]
Fetched 50.7 kB in 0s (281 kB/s)               
Selecting previously unselected package python3-dbus.mainloop.pyqt5.
(Reading database ... 475713 files and directories currently installed.)
Preparing to unpack .../python3-dbus.mainloop.pyqt5_5.14.1+dfsg-3build1_amd64.deb ...
Unpacking python3-dbus.mainloop.pyqt5 (5.14.1+dfsg-3build1) ...
Selecting previously unselected package pulseaudio-equalizer.
Preparing to unpack .../pulseaudio-equalizer_1%3a13.99.1-1ubuntu3.7_amd64.deb ...
Unpacking pulseaudio-equalizer (1:13.99.1-1ubuntu3.7) ...
Setting up python3-dbus.mainloop.pyqt5 (5.14.1+dfsg-3build1) ...
Setting up pulseaudio-equalizer (1:13.99.1-1ubuntu3.7) ...

$ qpaeq
There was an error importing needed libraries
Make sure you have qt5 and dbus-python installed
The error that occurred was:
    No module named 'dbus'

$ sudo apt-get install python-dbus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-dbus is already the newest version (1.2.16-1build1).
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

$ qpaeq
There was an error importing needed libraries
Make sure you have qt5 and dbus-python installed
The error that occurred was:
    No module named 'dbus'

$ sudo apt-get install dbus-python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package dbus-python

答案1

如果出现此错误,则可能需要几个模块,如上面的注释中所述。如果希望更改永久生效,则需要从 加载模块/etc/pulse/default.pa。将以下几行添加到文件底部:

load-module module-equalizer-sink
load-module module-dbus-protocol

您可以使用 触发更改立即生效pulseaudio -k

答案2

我遇到了同样的问题。

对我来说,这是由于本地安装的版本pyqt5可能不是最新的(或者缺少系统打包程序提供的某些内容)造成的。

您可以通过以下方式检查:

$ python
Python 3.9.2 (default, Feb 20 2021, 18:40:11)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus.mainloop; print(dbus.mainloop)
<module 'dbus.mainloop' from '[PATH]'>

如果 的值[PATH]指向你的主目录的某个地方(例如从 开始/home/...),那么你已经在本地安装了 pyqt5,并且它可能删除它是个好主意,离开那里只有包管理器安装了一个。

使用 ( 删除它无需使用 sudo)通过发出pip uninstall pyqt5(它会询问并显示您从哪里删除包,应该[PATH]与之匹配)。

相关内容