Skip to content

module 'PySide6.QtGui' has no attribute 'QApplication' or Failed to enable GUI event loop integration for 'qt' #1851

Description

@Saltsmart

Before creating a new issue, please check the FAQ to see if your question is answered there.

Environment data

OS:

  • debugpy version: 1.8.12 (run import debugpy; print(debugpy.__version__) if uncertain)
  • OS and version: Windows_NT x64 10.0.22000
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.2
  • Using VS Code or Visual Studio: VS Code 1.97.2 (system setup)

Actual behavior

Print the following:

Failed to enable GUI event loop integration for 'qt'
Traceback (most recent call last):
  File "c:\Users\Administrator\.vscode\extensions\ms-python.debugpy-2025.0.1-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\matplotlibtools.py", line 49, in do_enable_gui
    enable_gui(guiname)
    ~~~~~~~~~~^^^^^^^^^
  File "c:\Users\Administrator\.vscode\extensions\ms-python.debugpy-2025.0.1-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 567, in enable_gui
    return gui_hook(app)
  File "c:\Users\Administrator\.vscode\extensions\ms-python.debugpy-2025.0.1-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 180, in enable_qt
    from pydev_ipython.qt_for_kernel import QT_API, QT_API_PYQT5, QT_API_PYQT6
  File "c:\Users\Administrator\.vscode\extensions\ms-python.debugpy-2025.0.1-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\qt_for_kernel.py", line 132, in <module>
    QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
                                   ~~~~~~~^^^^^^^^^^
  File "c:\Users\Administrator\.vscode\extensions\ms-python.debugpy-2025.0.1-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\qt_loaders.py", line 356, in load_qt
        raise ImportError(
    ...<24 lines>...
        )
ImportError:
    Could not load requested Qt binding. Please ensure that
    PyQt4 >= 4.7 or PySide >= 1.0.3 is available,
    and only one is imported per session.

    Currently-imported Qt library:   None
    PyQt4 installed:                 False
    PyQt5 installed:                 False
    PyQt6 installed:                 False
    PySide >= 1.0.3 installed:       False
    PySide2 installed:               False
    PySide6 installed:               True
    Tried to load:                   ['pyqtdefault', 'pyside', 'pyside2', 'pyqt5', 'pyqt6']

Expected behavior

No error info.

Steps to reproduce:

Debug the following file:

import matplotlib

matplotlib.use("qtagg")
print(matplotlib.get_backend())

Metadata

Metadata

Labels

duplicateThis issue or pull request already exists

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions