Skip to content

7.27.0 Qt6 support throws exception with PyQt6 on Windows #13116

Closed

Description

@pijyoi

PyQt6 6.1.1 / Windows 10 20H2

PS C:\work> .\venv\pyqt6\Scripts\Activate.ps1
(pyqt6) PS C:\work> ipython
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %gui qt

In [2]: Traceback (most recent call last):
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\work\venv\pyqt6\Scripts\ipython.exe\__main__.py", line 7, in <module>
    sys.exit(start_ipython())
  File "c:\work\venv\pyqt6\lib\site-packages\IPython\__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "c:\work\venv\pyqt6\lib\site-packages\traitlets\config\application.py", line 845, in launch_instance
    app.start()
  File "c:\work\venv\pyqt6\lib\site-packages\IPython\terminal\ipapp.py", line 356, in start
    self.shell.mainloop()
  File "c:\work\venv\pyqt6\lib\site-packages\IPython\terminal\interactiveshell.py", line 564, in mainloop
    self.interact()
  File "c:\work\venv\pyqt6\lib\site-packages\IPython\terminal\interactiveshell.py", line 547, in interact
    code = self.prompt_for_code()
    text = self.pt_app.prompt(
  File "c:\work\venv\pyqt6\lib\site-packages\prompt_toolkit\shortcuts\prompt.py", line 1020, in prompt
    return self.app.run(
  File "c:\work\venv\pyqt6\lib\site-packages\prompt_toolkit\application\application.py", line 891, in run
    return loop.run_until_complete(
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1823, in _run_once
    event_list = self._selector.select(timeout)
  File "c:\work\venv\pyqt6\lib\site-packages\prompt_toolkit\eventloop\inputhook.py", line 117, in select
    self.inputhook(InputHookContext(self._r, input_is_ready))
  File "c:\work\venv\pyqt6\lib\site-packages\IPython\terminal\pt_inputhooks\qt.py", line 67, in inputhook
    event_loop.exec_()
AttributeError: 'QEventLoop' object has no attribute 'exec_'

Other combinations tested to not have this issue:

  1. PySide6 6.1.2 / Windows 10 20H2 / Python 3.8.10
  2. PyQt6 6.1.1 / Ubuntu 20.04 / Python 3.8.10

Activity

  1. tacaswell commented on Sep 1, 2021

    @tacaswell
    Contributor

    🤦🏻 I missed the win32 branch, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions