Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Saltsmart opened this issue Mar 1, 2025 · 3 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@Saltsmart
Copy link

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())
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 1, 2025
@bersbersbers
Copy link
Contributor

Looks like a duplicate of #1222, #1112, #800, #704.

@bersbersbers
Copy link
Contributor

(Use "guiEventLoop": "none" in your launch config.)

@debonte
Copy link

debonte commented Mar 2, 2025

Thanks @bersbersbers!

@debonte debonte closed this as completed Mar 2, 2025
@debonte debonte added duplicate This issue or pull request already exists and removed needs repro Issue has not been reproduced yet labels Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants