{"id":24379,"library":"PyQt5-stubs","title":"PyQt5 Stubs","description":"PEP 561 compliant stub files (type hints) for the PyQt5 framework. Provides type information for static type checkers like mypy and Pyright. Current version 5.15.6.0, compatible with PyQt5 5.15.x. Released as needed for PyQt5 updates.","status":"active","version":"5.15.6.0","language":"python","source_language":"en","source_url":"https://github.com/python-qt-tools/PyQt5-stubs","tags":["pyqt5","stubs","type-hints","mypy"],"install":[{"cmd":"pip install PyQt5-stubs","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Runtime dependency; stubs are for PyQt5","package":"PyQt5","optional":false}],"imports":[{"note":"Common wrong module","wrong":"from PyQt5.QtGui import QWidget","symbol":"QWidget","correct":"from PyQt5.QtWidgets import QWidget"},{"note":"","wrong":"","symbol":"QPushButton","correct":"from PyQt5.QtWidgets import QPushButton"}],"quickstart":{"code":"import sys\nfrom PyQt5.QtWidgets import QApplication, QPushButton\napp = QApplication(sys.argv)\nbutton = QPushButton('Click me')\nbutton.show()\nsys.exit(app.exec_())","lang":"python","description":"Display a simple PyQt5 button; stubs enable type checking."},"warnings":[{"fix":"Switch to PyQt6 and PyQt6-stubs for active support.","message":"PyQt5-stubs is no longer actively maintained; consider migrating to PyQt6 with PyQt6-stubs.","severity":"deprecated","affected_versions":">=5.15.6.0"},{"fix":"Check stub coverage; report missing stubs upstream.","message":"Stubs may not cover newer PyQt5 submodules (e.g., QtWebEngine, Qt3D) as thoroughly.","severity":"gotcha","affected_versions":">=5.14.2.2"},{"fix":"Add type annotations to signals/slots or use `# type: ignore` locally.","message":"In version 5.15.2.0, strict mypy mode was enabled; existing code with untyped signals/slots may cause new errors.","severity":"breaking","affected_versions":"5.15.2.0+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install PyQt5","cause":"PyQt5 itself not installed.","error":"No module named 'PyQt5'"},{"fix":"pip install PyQt5-stubs","cause":"IDE or type checker not finding stubs due to missing PyQt5-stubs install.","error":"Cannot find reference 'QWidget' in '__init__.pyi'"},{"fix":"Upgrade Python to 3.5 or later.","cause":"Unsupported Python version.","error":"PyQt5-stubs 5.15.6.0 requires Python >=3.5, but Python 3.4 is installed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}