Tadinu February 2016

PyQt5 QtQuick Error - "libQt5Network undefined symbol: _Z24qt_subtract_from_timeoutii"

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.

Python.py:

# 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:

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";}
}

Answers


Tadinu February 2016

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

Post Status

Asked in February 2016
Viewed 3,397 times
Voted 14
Answered 1 times

Search




Leave an answer