简体   繁体   中英

Python3: ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found

I created a Window on Qt with Qt Designer and when I launch that app - I get ImportError. It feels like that library doesn't installed in my system. But the preview works in Qt Designer.

Full code of design file:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'map.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(576, 616)
        self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.webView = QtWebEngineWidgets.QWebView(Form)
        self.webView.setUrl(QtCore.QUrl("https://www.openstreetmap.org/"))
        self.webView.setRenderHints(QtGui.QPainter.Antialiasing|QtGui.QPainter.SmoothPixmapTransform|QtGui.QPainter.TextAntialiasing)
        self.webView.setObjectName("webView")
        self.horizontalLayout.addWidget(self.webView)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "VasMaps"))
        
from PyQt5 import QtWebEngineWidgets

Error log:

Traceback (most recent call last):
  File "Qt/map.py", line 31, in <module>
    from PyQt5 import QtWebEngineWidgets
ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /usr/local/lib/python3.8/dist-packages/PyQt5/QtWebEngineWidgets.abi3.so)

PyQtWebEngine package is installed via pip.

I try to uninstall pyqt5 and install it again,it is useful!

in pycharm terminal:

pip3 uninstall PyQt5

in ubuntu terminal:

sudo apt-get install python3-pyqt5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM