Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. PyQt5 QtQuick

PyQt5 QtQuick

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 2.2k 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.
  • T Offline
    T Offline
    Tadinu
    wrote on last edited by
    #1

    Hi,

    After installing PyQt5.5.1 together with Qt5.5.1 on my Ubuntu 14.04 successfully, I ran my simple pyqt file using QtQuick and met this error:

    libQt5Network.so.5: undefined symbol: _Z24qt_subtract_from_timeoutii

    Anyone has run into this before?

    Thanks.

    Pyquick.py:

    #!/usr/bin/env python3
    import sys
    from PyQt5.QtCore import QUrl
    from PyQt5.QtWidgets import QApplication
    from PyQt5.QtQuick import QQuickView
    
    # Main Function
    if __name__ == '__main__':
        # Create main app
        myApp = QApplication(sys.argv)
        # Create a label and set its properties
        appLabel = QQuickView()
        appLabel.setSource(QUrl('basic.qml'))
    
        # Show the Label
        appLabel.show()
    
        # Execute the Application and Exit
        myApp.exec_()
        sys.exit()
    

    basic.qml:

    import QtQuick 2.3
    
    Rectangle {
        width: 300; height: 300
        color: "red"
    
        Text {
            id: helloText
            anchors.verticalCenter: parent.verticalCenter
            anchors.horizontalCenter: parent.horizontalCenter
            text: "Hello World!!!\n Traditional first app using PyQt5"
            color: "blue"
            font.family: "Helvetica"
            font.pointSize: 14
            horizontalAlignment: Text.AlignHCenter
        }
    
        Grid {
            id: colorPicker
    
            rows: 2; columns: 3; spacing: 3
    
            Rectangle { color: "white";}
            Rectangle { color: "green";}
            Rectangle { color: "blue"; }
            Rectangle { color: "yellow";}
            Rectangle { color: "steelblue";}
            Rectangle { color: "black";}
        }
    }
    
    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tadinu
      wrote on last edited by Tadinu
      #2

      The reason is i also installed python-Qt5, which is based on older Qt5 version.
      With

      find / -name libQt*
      

      I could see some old qt lib residing in /usr/lib folder:

      /usr/lib/i386-linux-gnu/libQt5Network.so
      /usr/lib/i386-linux-gnu/libQt5Network.so.5
      /usr/lib/i386-linux-gnu/libQt5Network.so.5.2
      /usr/lib/i386-linux-gnu/libQt5Network.so.5.2.1

      /home/tad/Qt5.5.1/gcc/lib/libQt5Network.so.5.5
      /home/tad/Qt5.5.1/gcc/lib/libQt5Network.so
      /home/tad/Qt5.5.1/gcc/lib/libQt5Network.so.5.5.1
      /home/tad/Qt5.5.1/gcc/lib/libQt5Network.so.5

      /home/tad/Qt5.5.1/Tools/QtCreator/lib/qtcreator/libQt5Network.so.5
      /home/tad/Qt5.5.1/Tools/QtCreator/lib/qtcreator/libQt5Network.so.5.5.1
      /home/tad/Qt5.5.1/Tools/QtCreator/lib/qtcreator/libQt5Network.so.5

      The problem maybe inconsistent qt libs, so I remove all qt libs in /usr/lib and replace them with the ones in my home folder. It worked! However this is not recommended since some built-in Ubuntu components may use libQt* in /usr/lib folders. So, just remove python-qt5 and reinstall pyqt5 all over again!

      By the way, for the error relating to Sip API version, we just have to run to remove all sip-related packages then reinstall sip again:

      dpkg -l | grep sip
      

      then

      sudo apt-get purge python3-sip python3-sip-dev
      
      1 Reply Last reply
      1

      • Login

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