Openshot lässt sich in Ubuntu 18.04 nicht öffnen. Kein Modul mit dem Namen PyQt5.QtWebKitWidgets

Openshot lässt sich in Ubuntu 18.04 nicht öffnen. Kein Modul mit dem Namen PyQt5.QtWebKitWidgets

Ich habe Openshotin Ubuntu 18.04 LTS installiert mit

sudo apt-get install openshot-qt

Und wenn ich versuche, es im Terminal zu öffnen, openshot-qtschlägt es mit einem Fehler fehl:

Traceback (most recent call last):
  File "/usr/bin/openshot-qt", line 11, in <module>
    load_entry_point('openshot-qt==2.5.1.dev2', 'gui_scripts', 'openshot-qt')()
  File "/usr/lib/python3/dist-packages/openshot_qt/launch.py", line 97, in main
    app = OpenShotApp(argv)
  File "/usr/lib/python3/dist-packages/openshot_qt/classes/app.py", line 220, in __init__
    from windows.main_window import MainWindow
  File "/usr/lib/python3/dist-packages/openshot_qt/windows/main_window.py", line 45, in <module>
    from windows.views.timeline_webview import TimelineWebView
  File "/usr/lib/python3/dist-packages/openshot_qt/windows/views/timeline_webview.py", line 42, in <module>
    from PyQt5.QtWebKitWidgets import QWebView
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

Ich habe sudo apt-get install python3-pyqt5.qtwebenginees entsprechend versuchtFrage. Aber das Öffnen von openshot führt zum selben Fehler, obwohl der Befehl about Folgendes ausgibt:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pyqt5.qtwebengine is already the newest version (5.10.1+dfsg-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.

Kann jemand bitte die Lösung geben?

BEARBEITEN:

Ausgabe von apt-cache policy python3-pyqt5.qtwebkit:

python3-pyqt5.qtwebkit:
  Installed: 5.10.1+dfsg-1ubuntu2
  Candidate: 5.10.1+dfsg-1ubuntu2
  Version table:
 *** 5.10.1+dfsg-1ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Ausgabe von ls -l /usr/lib/python3/dist-packages/PyQt5/:

-rw-r--r-- 1 root root     826 Feb 27  2018 __init__.py
drwxr-xr-x 2 root root    4096 Sep 15  2019 __pycache__
-rw-r--r-- 1 root root  237384 Apr 23  2018 _QOpenGLFunctions_2_0.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  241624 Apr 23  2018 _QOpenGLFunctions_2_1.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  122296 Apr 23  2018 _QOpenGLFunctions_4_1_Core.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root 2955992 Apr 23  2018 QtCore.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  370919 Apr 23  2018 QtCore.pyi
-rw-r--r-- 1 root root    6120 Apr 23  2018 Qt.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  212696 Apr 23  2018 QtDBus.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   22776 Apr 23  2018 QtDBus.pyi
-rw-r--r-- 1 root root  332392 Apr 23  2018 QtDesigner.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   22328 Apr 23  2018 QtDesigner.pyi
-rw-r--r-- 1 root root 3287320 Apr 23  2018 QtGui.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  382629 Apr 23  2018 QtGui.pyi
-rw-r--r-- 1 root root  157560 Apr 23  2018 QtHelp.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    9226 Apr 23  2018 QtHelp.pyi
-rw-r--r-- 1 root root  698304 Apr 23  2018 QtMultimedia.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   83508 Apr 23  2018 QtMultimedia.pyi
-rw-r--r-- 1 root root  102848 Apr 23  2018 QtMultimediaWidgets.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    4571 Apr 23  2018 QtMultimediaWidgets.pyi
-rw-r--r-- 1 root root  859448 Apr 23  2018 QtNetwork.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   94874 Apr 23  2018 QtNetwork.pyi
-rw-r--r-- 1 root root  143192 Apr 23  2018 QtOpenGL.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   15653 Apr 23  2018 QtOpenGL.pyi
-rw-r--r-- 1 root root  239720 Apr 23  2018 QtPrintSupport.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   19835 Apr 23  2018 QtPrintSupport.pyi
-rw-r--r-- 1 root root  104528 Apr 23  2018 QtSvg.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    5909 Apr 23  2018 QtSvg.pyi
-rw-r--r-- 1 root root  103104 Apr 23  2018 QtTest.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   10827 Apr 23  2018 QtTest.pyi
-rw-r--r-- 1 root root   33920 Apr 23  2018 QtWebChannel.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    2480 Apr 23  2018 QtWebChannel.pyi
-rw-r--r-- 1 root root   67992 Apr 23  2018 QtWebEngineCore.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    7141 Apr 23  2018 QtWebEngineCore.pyi
-rw-r--r-- 1 root root   54304 Apr 23  2018 QtWebEngine.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    6582 Apr 23  2018 QtWebEngine.pyi
-rw-r--r-- 1 root root  239800 Apr 23  2018 QtWebEngineWidgets.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   32973 Apr 23  2018 QtWebEngineWidgets.pyi
-rw-r--r-- 1 root root  170264 Apr 23  2018 QtWebKit.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   18340 Apr 23  2018 QtWebKit.pyi
-rw-r--r-- 1 root root  317720 Apr 23  2018 QtWebKitWidgets.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   32123 Apr 23  2018 QtWebKitWidgets.pyi
-rw-r--r-- 1 root root 5498280 Apr 23  2018 QtWidgets.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root  500483 Apr 23  2018 QtWidgets.pyi
-rw-r--r-- 1 root root  315744 Apr 23  2018 QtXml.cpython-36m-x86_64-linux-gnu.so
-rw-r--r-- 1 root root   27507 Apr 23  2018 QtXml.pyi
drwxr-xr-x 7 root root    4096 Sep 15  2019 uic

Ausgabe von python3 -c "import PyQt5.QtWebKitWidgets":

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

Antwort1

Es lohnt sich zu verstehen, was hier passiert, da die Lösung kontraintuitiv erscheint:

  • openshot-qtist in Python geschrieben und erfordert das PyQt5.QtWebKitWidgetsModul, das vom Ubuntu-Paket bereitgestellt wird python3-pyqt5.qtwebkit.
  • Alle von installierten Python-Module aptwerden in installiert /usr/lib/python3/dist-packages.
  • Alle Python-Module, die von den Python-Paketverwaltungstools (z. B. pip) installiert werden, werden in installiert /usr/local/lib/python3.6/dist-packages. Es gibt Ausnahmen von dieser Regel, z. B. bei der Verwendung vonvirtuelle Umgebungaber das ist hier nicht anwendbar.
  • Wenn ein Paket sowohl in /usr/local/lib/python3.6/dist-packagesals auch vorhanden ist /usr/lib/python3/dist-packages, hat die Version in /usr/local/lib/python3.6/dist-packagesVorrang (dies ist die von installierte Version pip).
  • Das hier ist wichtig: Unterstützung PyQt5entfernt inQtWebKitWidgetsVersion 5.6in ihrer Distribution. Ubuntu scheint in seinem v5.10-Paket benutzerdefinierte Unterstützung dafür beibehalten zu haben.
    • Es scheint, dass die installierte Version /usr/local/lib/python3.6/dist-packages>= v5.6 ist.

Ihr Problem besteht also darin, dass eine neuere Version von ohne das von Ihnen benötigte Modul installiert ist PyQt5, die im Wesentlichen die Ubuntu-Version überschreibt, die das von Ihnen benötigte Modul enthält. Die Lösung besteht dann darin, die neuere Version zu entfernen, damit Ihr System die von Ubuntu bereitgestellte Version verwendet. Sie können dies tun, indem Sie ausführen sudo pip3 uninstall pyqt5. Bestätigen Sie anschließend, dass das Verzeichnis /usr/local/lib/python3.6/dist-packages/PyQt5verschwunden ist.

Es besteht die Möglichkeit, dass ein nicht von APT gesteuertes Programm tatsächlich die neuere Version benötigt, PyQt5aber für solche Situationen ist virtualenv da.

verwandte Informationen