Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQt5 - QtWebEngineWidgets, ImportError

PyQt5 - QtWebEngineWidgets, ImportError

Scheduled Pinned Locked Moved Unsolved Qt for Python
10 Posts 3 Posters 14.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cards
    wrote on last edited by
    #1

    Hallo everyone!

    I wanted to start a python-project by developing a web browser but I get stuck at the very start... quite annoying! I tried to check first at some similar problems in the web but without success.

    It seems that there is a problem with the location of the file libQt5Quick.so.5. I installed every package with pip3 (also uninstall and reinstall them).

    If someone could help me out of this I will be very happy!

    Thanks in advance,

    cards

    Here the details:

    Here the error:

    python3 -c "import PyQt5.QtWebEngineWidgets"
    

    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ImportError: libQt5Quick.so.5: cannot open shared object file: No such file or directory

    Here my settings:

    python3 --version
    

    Python 3.9.4

    pip3 list | grep PyQt
    

    PyQt5 5.15.4
    PyQt5-Qt5 5.15.2
    PyQt5-sip 12.9.0
    PyQtWebEngine 5.15.4
    PyQtWebEngine-Qt5 5.15.2

    Here the file location:

    find / -name "libQt5Quick.so.5" 2> /dev/null
    

    /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
    /usr/lib/python2.7/site-packages/PySide2/Qt/lib/libQt5Quick.so.5

    ls -l /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
    

    -rwxr-xr-x 1 root root 6.8M [...]

    JonBJ 1 Reply Last reply
    0
    • C cards

      Hallo everyone!

      I wanted to start a python-project by developing a web browser but I get stuck at the very start... quite annoying! I tried to check first at some similar problems in the web but without success.

      It seems that there is a problem with the location of the file libQt5Quick.so.5. I installed every package with pip3 (also uninstall and reinstall them).

      If someone could help me out of this I will be very happy!

      Thanks in advance,

      cards

      Here the details:

      Here the error:

      python3 -c "import PyQt5.QtWebEngineWidgets"
      

      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      ImportError: libQt5Quick.so.5: cannot open shared object file: No such file or directory

      Here my settings:

      python3 --version
      

      Python 3.9.4

      pip3 list | grep PyQt
      

      PyQt5 5.15.4
      PyQt5-Qt5 5.15.2
      PyQt5-sip 12.9.0
      PyQtWebEngine 5.15.4
      PyQtWebEngine-Qt5 5.15.2

      Here the file location:

      find / -name "libQt5Quick.so.5" 2> /dev/null
      

      /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
      /usr/lib/python2.7/site-packages/PySide2/Qt/lib/libQt5Quick.so.5

      ls -l /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
      

      -rwxr-xr-x 1 root root 6.8M [...]

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @cards said in PyQt5 - QtWebEngineWidgets, ImportError:

      ldd /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
      

      ?

      C 1 Reply Last reply
      0
      • JonBJ JonB

        @cards said in PyQt5 - QtWebEngineWidgets, ImportError:

        ldd /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
        

        ?

        C Offline
        C Offline
        cards
        wrote on last edited by
        #3

        @JonB thanks for the interest, here the object dependencies of libQt5Quick.so.5

        ldd /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
        
        linux-vdso.so.1 (0x00007ffe4cbd9000)
        libQt5QmlModels.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5QmlModels.so.5 (0x00007f2c660dc000)
        libQt5Qml.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Qml.so.5 (0x00007f2c65a60000)
        libQt5Gui.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5 (0x00007f2c6512f000)
        libQt5Network.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Network.so.5 (0x00007f2c64d81000)
        libQt5Core.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5 (0x00007f2c6458b000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f2c64547000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f2c644bf000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f2c642e2000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f2c6419d000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f2c64183000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f2c63fb6000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007f2c63fab000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f2c63f8f000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f2c63f88000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007f2c63f33000)
        libicui18n.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicui18n.so.56 (0x00007f2c63a9a000)
        libicuuc.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicuuc.so.56 (0x00007f2c636e2000)
        libicudata.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicudata.so.56 (0x00007f2c61cfd000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007f2c61cf8000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f2c61bc3000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f2c66a94000)
        libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f2c61b0b000)
        libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f2c61ad8000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007f2c619f1000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007f2c619be000)
        libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007f2c619b8000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007f2c619a9000)
        libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007f2c619a2000)
        libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f2c61988000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f2c61916000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f2c617d3000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f2c617a9000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f2c617a4000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f2c6179c000)
        
        JonBJ 1 Reply Last reply
        0
        • C cards

          @JonB thanks for the interest, here the object dependencies of libQt5Quick.so.5

          ldd /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Quick.so.5
          
          linux-vdso.so.1 (0x00007ffe4cbd9000)
          libQt5QmlModels.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5QmlModels.so.5 (0x00007f2c660dc000)
          libQt5Qml.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Qml.so.5 (0x00007f2c65a60000)
          libQt5Gui.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Gui.so.5 (0x00007f2c6512f000)
          libQt5Network.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Network.so.5 (0x00007f2c64d81000)
          libQt5Core.so.5 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libQt5Core.so.5 (0x00007f2c6458b000)
          libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f2c64547000)
          libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f2c644bf000)
          libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f2c642e2000)
          libm.so.6 => /usr/lib/libm.so.6 (0x00007f2c6419d000)
          libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f2c64183000)
          libc.so.6 => /usr/lib/libc.so.6 (0x00007f2c63fb6000)
          librt.so.1 => /usr/lib/librt.so.1 (0x00007f2c63fab000)
          libz.so.1 => /usr/lib/libz.so.1 (0x00007f2c63f8f000)
          libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f2c63f88000)
          libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007f2c63f33000)
          libicui18n.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicui18n.so.56 (0x00007f2c63a9a000)
          libicuuc.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicuuc.so.56 (0x00007f2c636e2000)
          libicudata.so.56 => /usr/lib/python3.9/site-packages/PyQt5/Qt5/lib/libicudata.so.56 (0x00007f2c61cfd000)
          libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00007f2c61cf8000)
          libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f2c61bc3000)
          /usr/lib64/ld-linux-x86-64.so.2 (0x00007f2c66a94000)
          libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f2c61b0b000)
          libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f2c61ad8000)
          libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007f2c619f1000)
          libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007f2c619be000)
          libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007f2c619b8000)
          libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007f2c619a9000)
          libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007f2c619a2000)
          libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f2c61988000)
          libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f2c61916000)
          libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f2c617d3000)
          libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f2c617a9000)
          libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f2c617a4000)
          libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f2c6179c000)
          
          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @cards Looks OK, no "not found"s.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cards
            wrote on last edited by cards
            #5

            Goooood to know! Other modules such as QtCore, QtGui, QtWidgets, ... just work fine. Could it be something related to the path of the application executable? Or do you know others modules where the libQt5Quick.so.5 is required so that I can try to check if I get a similar error? Or...anything else?

            JonBJ 1 Reply Last reply
            0
            • C cards

              Goooood to know! Other modules such as QtCore, QtGui, QtWidgets, ... just work fine. Could it be something related to the path of the application executable? Or do you know others modules where the libQt5Quick.so.5 is required so that I can try to check if I get a similar error? Or...anything else?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @cards
              TBH I'm surprised QtWebEngineWidgets wants anything "QtQuick" at all. But I don't know that to be the case.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cards
                wrote on last edited by cards
                #7

                Thanks for your effort... If you will have any ideas be free to share them... the "easier" it looks, the more "difficult" it is, and this seems just to easy, so in this case a huge pain.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  cards
                  wrote on last edited by cards
                  #8

                  Some brain-damage updates:

                  Step 0: not working sample code
                  here my sample program (just copied-pasted from the web [I just needed smt working]) which gives rise to the famous

                  ImportError: libQt5Quick.so.5: cannot open shared object file: No such file or directory

                  #!/bin/python3
                  # -*- coding: utf-8 -*-
                  
                  from PyQt5.QtCore import *
                  from PyQt5.QtWidgets import *
                  from PyQt5.QtGui import *
                  from PyQt5.QtWebEngineWidgets import *
                  
                  
                  import sys
                  
                  class MainWindow(QMainWindow):
                  
                      def __init__(self, *args, **kwargs):
                          super(MainWindow,self).__init__(*args, **kwargs)
                  
                          self.browser = QWebEngineView()
                          self.browser.setUrl(QUrl("https://doc.qt.io/qt-6/"))
                  
                          self.setCentralWidget(self.browser)
                  
                          self.show()
                  
                  app = QApplication(sys.argv)
                  window = MainWindow()
                  
                  app.exec_()
                  

                  step 1: towards a debugging of the QtWebEngineWidgets-import
                  I execute only this code

                  #!/bin/python3
                  # -*- coding: utf-8 -*-
                  # list of PyQt modules
                  qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                  # check if import modules is working
                  for m in qt_modules:
                     cmd = 'import PyQt5.{}'.format(m) # string command
                     try:
                         exec (cmd)
                         exec ('del PyQt5.{}'.format(m)) # delete the import right after to avoid side effects
                  	#print('[OK] import: ', cmd)
                     except Exception as e:
                         #print('[Er] import: ', cmd)
                         print(type(e), e)
                  

                  output:
                  [Er] import: import PyQt5.QAxContainer
                  [Er] import: import PyQt5.QtMacExtras
                  [Er] import: import PyQt5.QtWebKit
                  [Er] import: import PyQt5.QtWebKitWidgets
                  [Er] import: import PyQt5.QtWebWinExtra

                  Comment: ... the QtWebEngineWidgets does not rise to problems!!

                  step 2: I run 1st step 1 and then step 0

                  #!/bin/python3
                  # -*- coding: utf-8 -*-
                  # list of PyQt modules
                  [...]
                  #blah blah from step 1
                  qt_modules = [...] 
                  from PyQt5.QtCore import *
                  from PyQt5.QtWidgets import *
                  from PyQt5.QtGui import *
                  from PyQt5.QtWebEngineWidgets import *
                  
                  import sys
                  
                  class MainWindow(QMainWindow):
                  #blah blah from step 0
                  [...]
                  

                  Output
                  Could not find QtWebEngineProcess
                  Comment: I guess the by importing all PyQt5 modules the famous shared file libQt5Quick.so.5 is somehow it is fixed... but then another problem arise, no QtWebEngineProcess!
                  What's going on? ...it seems that importing QtWebEngineWidgets module is more like a combinatorial problem!

                  step 2*: summary - the import combinatorial-problem

                  #!/bin/python3
                  # -*- coding: utf-8 -*-
                  
                  qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                  
                  for m in qt_modules:
                      cmd = 'import PyQt5.{}'.format(m)
                      try:
                  	exec (cmd)
                  	exec ('del PyQt5.{}'.format(m)) # delete the import right after to avoid side effects
                      except Exception as e:
                          pass
                  		
                  from PyQt5.QtWebEngineWidgets import *
                  print('QWebEngineView' in dir())
                  

                  Output
                  True
                  Comment: much better, but what about step 2 and the Could not find QtWebEngineProcess? I still cannot run any program!

                  TODO - Extra brain damage challange: I tried to detect the dependencies (don't how to call them) using a combinatorial approach to fix the module(s) which are responsible(s) to fix the libQt5Quick.so.5 problem BUT I don't know how to refresh to the original setting the python environment... (I am not sure the using the del command is enough)

                  #!/bin/python3
                  # -*- coding: utf-8 -*-
                  from itertools import permutations
                  
                  qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                  
                  for p1, p2 in permutations(qt_modules, 2): # to start just check for pair
                     try:
                  	cmd1 = 'import PyQt5.{}'.format(p1)
                  	cmd2= 'import PyQt5.{}'.format(p2)
                  	exec (cmd1) 	# import a pair of Qt5 modules
                  	exec (cmd2)
                  	from PyQt5.QtWebEngineWidgets import QWebEngineView # import test
                  	print('Found lucky pair of modules: {}, {}'.format(p1, p2))
                  
                  	exec ('del PyQt5.{}'.format(p1)) # delete the import right after to avoid side effects
                  	exec ('del PyQt5.{}'.format(p2)) # delete the import right after to avoid side effects
                      except :
                          pass
                  

                  Output:
                  Found lucky pair od modules: QtBluetooth, QtWebChannel # it is the 56-combination!
                  [...] then follows many many other but they could be biased since I don't how to refresh the python shell to the original setting

                  Summa summarum

                  • libQt5Quick.so.5 dependencies

                  • how to start QtWebEngineProcess?

                  Any kind of hits and/or solutions are welcome!!

                  JonBJ 1 Reply Last reply
                  0
                  • C cards

                    Some brain-damage updates:

                    Step 0: not working sample code
                    here my sample program (just copied-pasted from the web [I just needed smt working]) which gives rise to the famous

                    ImportError: libQt5Quick.so.5: cannot open shared object file: No such file or directory

                    #!/bin/python3
                    # -*- coding: utf-8 -*-
                    
                    from PyQt5.QtCore import *
                    from PyQt5.QtWidgets import *
                    from PyQt5.QtGui import *
                    from PyQt5.QtWebEngineWidgets import *
                    
                    
                    import sys
                    
                    class MainWindow(QMainWindow):
                    
                        def __init__(self, *args, **kwargs):
                            super(MainWindow,self).__init__(*args, **kwargs)
                    
                            self.browser = QWebEngineView()
                            self.browser.setUrl(QUrl("https://doc.qt.io/qt-6/"))
                    
                            self.setCentralWidget(self.browser)
                    
                            self.show()
                    
                    app = QApplication(sys.argv)
                    window = MainWindow()
                    
                    app.exec_()
                    

                    step 1: towards a debugging of the QtWebEngineWidgets-import
                    I execute only this code

                    #!/bin/python3
                    # -*- coding: utf-8 -*-
                    # list of PyQt modules
                    qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                    # check if import modules is working
                    for m in qt_modules:
                       cmd = 'import PyQt5.{}'.format(m) # string command
                       try:
                           exec (cmd)
                           exec ('del PyQt5.{}'.format(m)) # delete the import right after to avoid side effects
                    	#print('[OK] import: ', cmd)
                       except Exception as e:
                           #print('[Er] import: ', cmd)
                           print(type(e), e)
                    

                    output:
                    [Er] import: import PyQt5.QAxContainer
                    [Er] import: import PyQt5.QtMacExtras
                    [Er] import: import PyQt5.QtWebKit
                    [Er] import: import PyQt5.QtWebKitWidgets
                    [Er] import: import PyQt5.QtWebWinExtra

                    Comment: ... the QtWebEngineWidgets does not rise to problems!!

                    step 2: I run 1st step 1 and then step 0

                    #!/bin/python3
                    # -*- coding: utf-8 -*-
                    # list of PyQt modules
                    [...]
                    #blah blah from step 1
                    qt_modules = [...] 
                    from PyQt5.QtCore import *
                    from PyQt5.QtWidgets import *
                    from PyQt5.QtGui import *
                    from PyQt5.QtWebEngineWidgets import *
                    
                    import sys
                    
                    class MainWindow(QMainWindow):
                    #blah blah from step 0
                    [...]
                    

                    Output
                    Could not find QtWebEngineProcess
                    Comment: I guess the by importing all PyQt5 modules the famous shared file libQt5Quick.so.5 is somehow it is fixed... but then another problem arise, no QtWebEngineProcess!
                    What's going on? ...it seems that importing QtWebEngineWidgets module is more like a combinatorial problem!

                    step 2*: summary - the import combinatorial-problem

                    #!/bin/python3
                    # -*- coding: utf-8 -*-
                    
                    qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                    
                    for m in qt_modules:
                        cmd = 'import PyQt5.{}'.format(m)
                        try:
                    	exec (cmd)
                    	exec ('del PyQt5.{}'.format(m)) # delete the import right after to avoid side effects
                        except Exception as e:
                            pass
                    		
                    from PyQt5.QtWebEngineWidgets import *
                    print('QWebEngineView' in dir())
                    

                    Output
                    True
                    Comment: much better, but what about step 2 and the Could not find QtWebEngineProcess? I still cannot run any program!

                    TODO - Extra brain damage challange: I tried to detect the dependencies (don't how to call them) using a combinatorial approach to fix the module(s) which are responsible(s) to fix the libQt5Quick.so.5 problem BUT I don't know how to refresh to the original setting the python environment... (I am not sure the using the del command is enough)

                    #!/bin/python3
                    # -*- coding: utf-8 -*-
                    from itertools import permutations
                    
                    qt_modules = ['QAxContainer','QtBluetooth','QtCore','QtDBus','QtDesigner','QtGui','QtHelp','QtLocation','QtMacExtras','QtMultimedia','QtMultimediaWidgets','QtNetwork','QtNfc','QtOpenGL','QtPositioning','QtPrintSupport','QtQml','QtQuick','QtQuickWidgets','QtSensors','QtSerialPort','QtSql','QtSvg','QtTest','QtWebChannel','QtWebEngineCore','QtWebEngineWidgets','QtWebKit','QtWebKitWidgets','QtWebSockets','QtWidgets','QtWinExtras','QtX11Extras','QtXml']
                    
                    for p1, p2 in permutations(qt_modules, 2): # to start just check for pair
                       try:
                    	cmd1 = 'import PyQt5.{}'.format(p1)
                    	cmd2= 'import PyQt5.{}'.format(p2)
                    	exec (cmd1) 	# import a pair of Qt5 modules
                    	exec (cmd2)
                    	from PyQt5.QtWebEngineWidgets import QWebEngineView # import test
                    	print('Found lucky pair of modules: {}, {}'.format(p1, p2))
                    
                    	exec ('del PyQt5.{}'.format(p1)) # delete the import right after to avoid side effects
                    	exec ('del PyQt5.{}'.format(p2)) # delete the import right after to avoid side effects
                        except :
                            pass
                    

                    Output:
                    Found lucky pair od modules: QtBluetooth, QtWebChannel # it is the 56-combination!
                    [...] then follows many many other but they could be biased since I don't how to refresh the python shell to the original setting

                    Summa summarum

                    • libQt5Quick.so.5 dependencies

                    • how to start QtWebEngineProcess?

                    Any kind of hits and/or solutions are welcome!!

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #9

                    @cards
                    This all sounds unnecessarily complex. I installed Qt5 + PyQt5 + QtWebEngine up to and including Ubuntu 20.04, and never had your problems/issues.

                    I can't be sure how I differ from you. One thing is I never build anything, I fetch everything from ubuntu apt-get. Something like:

                    sudo apt-get install python3-pyqt5 python3-pyqt5.qtwebengine
                    

                    I never from ... import *, I just do from PyQt5.QtWebEngineWidgets import QWebEngineView.

                    I note that I have /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5 plus various files (meaning it got installed via apt-get).

                    You never need to "how to start QtWebEngineProcess?". It will get started when your Python program accesses a WebEngine thing.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sharose
                      wrote on last edited by sharose
                      #10

                      hi, I have stuck in the same issue on my Ubuntu 20.04. When I tried to install it via apt-get I got the following message:

                      $ python3 test_leeafmap.py 
                      Traceback (most recent call last):
                        File "test_leeafmap.py", line 3, in <module>
                          from PyQt5.QtWebEngineWidgets import QWebEngineView
                      ImportError: libQt5Quick.so.5: cannot open shared object file: No such file or directory
                      
                      $ sudo apt-get install python3-pyqt5.qtwebchannel
                      Reading package lists... Done
                      Building dependency tree       
                      Reading state information... Done
                      python3-pyqt5.qtwebchannel is already the newest version (5.15.2+dfsg-1~ubuntu20.04.1~ppa1).
                      0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.
                      
                      $ sudo apt-get install python3-pyqt5.qtwebengine
                      Reading package lists... Done
                      Building dependency tree       
                      Reading state information... Done
                      Some packages could not be installed. This may mean that you have
                      requested an impossible situation or if you are using the unstable
                      distribution that some required packages have not yet been created
                      or been moved out of Incoming.
                      The following information may help to resolve the situation:
                      
                      The following packages have unmet dependencies:
                       python3-pyqt5.qtwebengine : Depends: python3-pyqt5.qtwebchannel (>= 5.12) but it is not going to be installed
                      E: Unable to correct problems, you have held broken packages.
                      

                      Where am I wrong... Any update or help on this?

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved