Search code examples
pythonpyqt5python-3.11

DeprecationWarning: sipPyTypeDict() is deprecated PyQt5


I was writing the most simplest piece of code to run some small app.

I got the next warning message:

~\PycharmProjects\LoggerTest\main.py:10: DeprecationWarning: sipPyTypeDict() is deprecated, the extension module should use sipPyTypeDictRef() instead
  class MainWindow(QMainWindow):

My code:

# Import libraries
import sys
# from PyQt5 import QtGui
# from PyQt5.QtCore import QEvent
from PyQt5.QtWidgets import QApplication, QMainWindow
# from PyQt5.QtCore import pyqtSignal #, pyqtSlot
from gui_ui import Ui_MainWindow


class MainWindow(QMainWindow):

    def __init__(self, parent=None, **kwargs):
        super(MainWindow, self).__init__(parent=parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    g = MainWindow()
    app.exec_()

What does that warning mean?


Solution

  • It is solved in python-3.12.0

    After upgrading, the warning should be away.

    Ref: https://github.com/python/cpython/pull/105747