libQt5MultimediaQuick.so.5:无法打开共享对象文件:没有这样的文件或目录



我正在做一个名为RaspMedia的项目(我的项目文件夹也就是这个名字(。我使用PyQt5将QML和python组合在一起。

我已经尝试使用main.qml文件中的import语句import QtMutimedia 5.14导入QtMultedia。

这是我完整的python代码。

main.py

from PyQt5.QtCore import QObject, QUrl,QMimeDatabase,QVariant,QFileInfo,QMetaObject,Q_ARG
from PyQt5.QtWidgets import QApplication
from PyQt5.QtQml import QQmlApplicationEngine
import os
import sys
home = os.environ["HOME"]+"/"
print(home)
currentPath = home
def getList(directory:type=str):
a = os.popen("ls '"+directory+"'")
b = []
for i in a:
b.append(i.replace("n", ""))
return b
def appendToList(mainList:type=list):
for i in mainList:
path = currentPath + i
mime = QMimeDatabase().mimeTypeForFile(QFileInfo(path)).name()
if mime == "inode/directory":
anObject = {"type":"folder", "name":i, "path":path }
QMetaObject.invokeMethod(win, "append", Q_ARG(QVariant, anObject))
print(anObject)
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
if __name__ == '__main__':
file = os.path.join(DIR_PATH, "main.qml")
url = QUrl.fromLocalFile(file)
myApp = QApplication(sys.argv)
engine = QQmlApplicationEngine()
context = engine.rootContext()
context.setContextProperty("main", engine)

engine.load(url)
win = engine.rootObjects()[0]
appendToList(getList(home))
win.show()
sys.exit(myApp.exec_())

运行它给了我错误跟随

file:///home/newtron/RaspMedia/main.qml:5:1: plugin cannot be loaded for module "QtMultimedia": Cannot load library /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/libdeclarative_multimedia.so: (libQt5MultimediaQuick.so.5: cannot open shared object file: No such file or directory)

在同一方面,pyside顺利地运行了脚本,没有任何错误。

这是ldd /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/libdeclarative_multimedia.so的完整输出

linux-vdso.so.1 (0x00007fff65783000)
libQt5MultimediaQuick.so.5 => not found
libQt5Multimedia.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Multimedia.so.5 (0x00007fe0d8bdc000)
libQt5Quick.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Quick.so.5 (0x00007fe0d84b1000)
libQt5Gui.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Gui.so.5 (0x00007fe0d7b9e000)
libQt5QmlModels.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5QmlModels.so.5 (0x00007fe0d7904000)
libQt5Qml.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Qml.so.5 (0x00007fe0d72b7000)
libQt5Network.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Network.so.5 (0x00007fe0d6f0c000)
libQt5Core.so.5 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libQt5Core.so.5 (0x00007fe0d6732000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fe0d64a6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe0d6287000)
libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007fe0d6082000)
libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007fe0d5e32000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fe0d5b1b000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe0d5792000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe0d53f4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe0d51dc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe0d4deb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe0d4bce000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe0d49c6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe0d47c2000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fe0d4577000)
libicui18n.so.56 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libicui18n.so.56 (0x00007fe0d40de000)
libicuuc.so.56 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libicuuc.so.56 (0x00007fe0d3d26000)
libicudata.so.56 => /usr/local/lib/python3.6/dist-packages/PyQt5/Qt/qml/QtMultimedia/../../lib/libicudata.so.56 (0x00007fe0d2343000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fe0d2141000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe0d9143000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fe0d1f10000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fe0d1c5a000)
libpulsecommon-11.1.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so (0x00007fe0d19dc000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fe0d178f000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fe0d151d000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fe0d1247000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fe0d1015000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fe0d0e11000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fe0d0c06000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fe0d08ce000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fe0d06a6000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fe0d0422000)
libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007fe0d0218000)
libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007fe0cff9f000)
libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007fe0cfd99000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fe0cfb95000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fe0cf97a000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fe0cf776000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fe0cf570000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fe0cf34a000)
liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fe0cf12e000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fe0cee12000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fe0cebf8000)
libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007fe0ce981000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007fe0ce778000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007fe0ce54d000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007fe0ce2a4000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fe0ce08f000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fe0cde7a000)

我需要安装吗

软件信息

  • PyQt版本:5.14.1
  • Qt版本:5.14.1
  • Python版本:3.6
  • os:Ubuntu2004年18月

我想好了如何修复它。PyQt5在MultiMediaQuick包中有一个错误。所以我复制粘贴了

  • Qt5.14.1/5.1/gcc_64/lib/libQt5MultimediaQuick.la
  • Qt5.14.1/5.14.1/gcc_64/lib/libQt5MultimediaQuick.so
  • Qt5.14.1/5.14.1/gcc_64/lib/libQt5MultimediaQuick.prl
  • Qt5.14.1/5.14.1/gcc_64/lib/libQt5Multimedia.so.5.14.1
  • Qt5.14.1/5.14.1/gcc_64/lib/libQt5MultimediaQuick.so.5文件到/usr/local/lib/python3.6/dist-packages/PyQt5/Qt/和一些额外的文件,如gstreamer和include文件夹。现在它工作得很好

相关内容

  • 没有找到相关文章

最新更新